diff options
author | Patrik Nyblom <[email protected]> | 2010-01-20 10:43:27 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-01-20 10:43:27 +0000 |
commit | 8597e538b77e83348d6cea7782765d9267783c0a (patch) | |
tree | 7f96a06235efe5e6deb9ab0d585fa293d7479c2e | |
parent | ec976a83f338e5407111af965c05eb5d714cc864 (diff) | |
download | otp-8597e538b77e83348d6cea7782765d9267783c0a.tar.gz otp-8597e538b77e83348d6cea7782765d9267783c0a.tar.bz2 otp-8597e538b77e83348d6cea7782765d9267783c0a.zip |
OTP-8375 A bug causing memory corruption in re:run() has been corrected.
(Thanks to Yamashina Hio.)
-rw-r--r-- | erts/emulator/beam/erl_bif_re.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/erts/emulator/beam/erl_bif_re.c b/erts/emulator/beam/erl_bif_re.c index 16abab65b0..6efc19597b 100644 --- a/erts/emulator/beam/erl_bif_re.c +++ b/erts/emulator/beam/erl_bif_re.c @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 2008-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 2008-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ @@ -1020,6 +1020,9 @@ re_run_3(BIF_ALIST_3) goto handle_iolist; } pb = (ProcBin *) bptr; + if (pb->flags) { + erts_emasculate_writable_binary(pb); + } restart.subject = (char *) (pb->bytes+offset); restart.flags |= RESTART_FLAG_SUBJECT_IN_BINARY; } else { |