aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_bif_info.c
diff options
context:
space:
mode:
authorRichard Carlsson <[email protected]>2015-12-03 14:33:53 +0100
committerSverker Eriksson <[email protected]>2016-02-08 16:11:56 +0100
commit14680fcc3fb9d0357fe33a94525d08896afed1c5 (patch)
tree40b1891cdbe478154d62262616494dbc27eabcf1 /erts/emulator/beam/erl_bif_info.c
parentacc4ac9f421e064bc0e573a9d5ecd26afe7cb8d6 (diff)
downloadotp-14680fcc3fb9d0357fe33a94525d08896afed1c5.tar.gz
otp-14680fcc3fb9d0357fe33a94525d08896afed1c5.tar.bz2
otp-14680fcc3fb9d0357fe33a94525d08896afed1c5.zip
erts: Use Sint instead of int for list lengths
This avoids potential integer arithmetic overflow for very large lists.
Diffstat (limited to 'erts/emulator/beam/erl_bif_info.c')
-rw-r--r--erts/emulator/beam/erl_bif_info.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index 017339e1f6..bc5c83e542 100644
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -1721,7 +1721,7 @@ info_1_tuple(Process* BIF_P, /* Pointer to current process. */
if (arity == 2) {
Eterm res = THE_NON_VALUE;
char *buf;
- int len = is_string(*tp);
+ Sint len = is_string(*tp);
if (len <= 0)
return res;
buf = (char *) erts_alloc(ERTS_ALC_T_TMP, len+1);
@@ -1740,7 +1740,7 @@ info_1_tuple(Process* BIF_P, /* Pointer to current process. */
else {
Eterm res = THE_NON_VALUE;
char *buf;
- int len = is_string(tp[1]);
+ Sint len = is_string(tp[1]);
if (len <= 0)
return res;
buf = (char *) erts_alloc(ERTS_ALC_T_TMP, len+1);