diff options
author | Björn Gustavsson <[email protected]> | 2011-05-13 14:18:35 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-05-13 14:18:35 +0200 |
commit | 0dde47552986f06dc31d43586f6c31d82050f60d (patch) | |
tree | f0fffd6302b6b1e64114b8062920ed92bc6ce2b3 /erts/emulator/beam/erl_nif.c | |
parent | 6f6f9e1a6fd96efd86673855cbdcd316c445c753 (diff) | |
parent | 875104fa418b2ead0f19250e75074002ae3e3c72 (diff) | |
download | otp-0dde47552986f06dc31d43586f6c31d82050f60d.tar.gz otp-0dde47552986f06dc31d43586f6c31d82050f60d.tar.bz2 otp-0dde47552986f06dc31d43586f6c31d82050f60d.zip |
Merge branch 'bjorn/fix-binary-overflow/OTP-9118' into dev
* bjorn/fix-binary-overflow/OTP-9118:
Fix overflow in list_to_bitstring/1
Replace io_list_len() with erts_iolist_size()
Make port_command/2 reject non-byte sized bitstrings
io.c: Make io_list_vec_len() less general
iolist_size/1: Fix truncation of result
Test iolist_size/1 with bad arguments
binary_SUITE: Remove workaround for avoiding stack overflow
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r-- | erts/emulator/beam/erl_nif.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c index 8b48444904..68421b4387 100644 --- a/erts/emulator/beam/erl_nif.c +++ b/erts/emulator/beam/erl_nif.c @@ -472,7 +472,7 @@ static void tmp_alloc_dtor(struct enif_tmp_obj_t* obj) int enif_inspect_iolist_as_binary(ErlNifEnv* env, Eterm term, ErlNifBinary* bin) { struct enif_tmp_obj_t* tobj; - int sz; + Uint sz; if (is_binary(term)) { return enif_inspect_binary(env,term,bin); } @@ -483,7 +483,7 @@ int enif_inspect_iolist_as_binary(ErlNifEnv* env, Eterm term, ErlNifBinary* bin) bin->ref_bin = NULL; return 1; } - if ((sz = io_list_len(term)) < 0) { + if (erts_iolist_size(term, &sz)) { return 0; } |