diff options
author | Sverker Eriksson <[email protected]> | 2013-11-27 18:58:14 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-11-27 18:58:14 +0100 |
commit | 35b4fd5d91cbeb1b9c8540996624856134e091e9 (patch) | |
tree | 1317c7dfa9054eee682c9194f16febb80a2ffc50 /erts | |
parent | f3589a79de29f1a4e6a2d03518739af214ae9600 (diff) | |
download | otp-35b4fd5d91cbeb1b9c8540996624856134e091e9.tar.gz otp-35b4fd5d91cbeb1b9c8540996624856134e091e9.tar.bz2 otp-35b4fd5d91cbeb1b9c8540996624856134e091e9.zip |
erts: Fix invalid read when appending binaries during call trace
Found by valgrind. Probably safe on opt-VM due to CHICKEN_PAD.
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/erl_bits.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_bits.c b/erts/emulator/beam/erl_bits.c index 872ded4be7..73765772c8 100644 --- a/erts/emulator/beam/erl_bits.c +++ b/erts/emulator/beam/erl_bits.c @@ -1491,7 +1491,7 @@ erts_bs_private_append(Process* p, Eterm bin, Eterm build_size_term, Uint unit) bptr->flags = 0; bptr->orig_size = new_size; erts_refc_init(&bptr->refc, 1); - sys_memcpy(bptr->orig_bytes, binp->orig_bytes, pb->size); + sys_memcpy(bptr->orig_bytes, binp->orig_bytes, binp->orig_size); pb->flags |= PB_IS_WRITABLE | PB_ACTIVE_WRITER; pb->val = bptr; pb->bytes = (byte *) bptr->orig_bytes; |