aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2013-06-05 18:23:02 +0200
committerPatrik Nyblom <[email protected]>2013-06-05 18:26:24 +0200
commite967d253c637f599b9f9237b605bc9c066032b41 (patch)
tree5d2dd81c68ac18926e76ff6d15656b159cf08e8c /erts
parent47d6fd3ccf35a4d921591dd0a9b5e69b9804b5b0 (diff)
downloadotp-e967d253c637f599b9f9237b605bc9c066032b41.tar.gz
otp-e967d253c637f599b9f9237b605bc9c066032b41.tar.bz2
otp-e967d253c637f599b9f9237b605bc9c066032b41.zip
Teach external.c to handle reallocs before compression
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/external.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/erts/emulator/beam/external.c b/erts/emulator/beam/external.c
index 9e86442f32..8a1e89afb4 100644
--- a/erts/emulator/beam/external.c
+++ b/erts/emulator/beam/external.c
@@ -1667,6 +1667,7 @@ static Eterm erts_term_to_binary_int(Process* p, Eterm Term, int level, Uint fla
/* To make absolutely sure that zlib does not barf on a reallocated context,
we make sure it's "exported" before doing anything compession-like */
EXPORT_CONTEXT();
+ bytes = (byte *) result_bin->orig_bytes; /* result_bin is reallocated */
if (erl_zlib_deflate_start(&(context->s.cc.stream),bytes+1,real_size-1,level)
!= Z_OK) {
goto return_normal;