aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db_util.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-03-09 10:42:58 +0100
committerBjörn Gustavsson <[email protected]>2011-03-09 14:01:03 +0100
commit1aa1166460dc22791ab909bb0a8565b2e12a1820 (patch)
treee87a13f69aa6b7a335b77e66e357d7662a60b305 /erts/emulator/beam/erl_db_util.c
parentc668eba73f72e8407158592bc65f37d5cc8aaaa3 (diff)
downloadotp-1aa1166460dc22791ab909bb0a8565b2e12a1820.tar.gz
otp-1aa1166460dc22791ab909bb0a8565b2e12a1820.tar.bz2
otp-1aa1166460dc22791ab909bb0a8565b2e12a1820.zip
Fix 18 exabyte memory allocation failure
The new_binary() function takes a size argument that is an int. In the 64-bit emulator (sizeof(int) == 4, sizeof(Uint) == 8), any sizes >= 0x8000000 become 0xffffffff80000000 and above and triggers a memory allocation failure. Change the type of the size argument to Uint, and change any callers that cast the argument to an int. Correction-by: Jon Meredith
Diffstat (limited to 'erts/emulator/beam/erl_db_util.c')
-rw-r--r--erts/emulator/beam/erl_db_util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c
index d3e31da413..0b63ab9ba0 100644
--- a/erts/emulator/beam/erl_db_util.c
+++ b/erts/emulator/beam/erl_db_util.c
@@ -2162,7 +2162,8 @@ restart:
case matchProcessDump: {
erts_dsprintf_buf_t *dsbufp = erts_create_tmp_dsbuf(0);
print_process_info(ERTS_PRINT_DSBUF, (void *) dsbufp, c_p);
- *esp++ = new_binary(build_proc, (byte *)dsbufp->str, (int)dsbufp->str_len);
+ *esp++ = new_binary(build_proc, (byte *)dsbufp->str,
+ dsbufp->str_len);
erts_destroy_tmp_dsbuf(dsbufp);
break;
}