aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/legacy/erl_marshal.c
diff options
context:
space:
mode:
authorMichael Santos <[email protected]>2011-01-23 18:16:36 -0500
committerBjörn-Egil Dahlberg <[email protected]>2011-02-22 16:37:17 +0100
commiteed4341a21b8e2c8e00d0321bde1213d7a4359df (patch)
tree6c19d9745ff984796f6c62b2d36093016c69417d /lib/erl_interface/src/legacy/erl_marshal.c
parentb0d6abb72cf32df548703b284b737a4a7c0a9d8a (diff)
downloadotp-eed4341a21b8e2c8e00d0321bde1213d7a4359df.tar.gz
otp-eed4341a21b8e2c8e00d0321bde1213d7a4359df.tar.bz2
otp-eed4341a21b8e2c8e00d0321bde1213d7a4359df.zip
erl_interface: fix buffer overflows
Diffstat (limited to 'lib/erl_interface/src/legacy/erl_marshal.c')
-rw-r--r--lib/erl_interface/src/legacy/erl_marshal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c
index 70949a7adf..5cfb5e2124 100644
--- a/lib/erl_interface/src/legacy/erl_marshal.c
+++ b/lib/erl_interface/src/legacy/erl_marshal.c
@@ -662,7 +662,7 @@ len = i
#define STATIC_NODE_BUF_SZ 30
#define SET_NODE(node,node_buf,cp,len) \
-if (len >= STATIC_NODE_BUF_SZ) node = malloc(len+1); \
+if (len >= STATIC_NODE_BUF_SZ) node = erl_malloc(len+1); \
else node = node_buf; \
memcpy(node, cp, len); \
node[len] = '\0'
@@ -1534,7 +1534,7 @@ static int cmp_string_list(unsigned char **e1, unsigned char **e2) {
if ( e1_len < 256 ) {
bp = buf;
} else {
- bp = malloc(5+(2*e1_len)+1);
+ bp = erl_malloc(5+(2*e1_len)+1);
}
bp[0] = ERL_LIST_EXT;