aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2015-10-12 14:59:37 +0200
committerLukas Larsson <[email protected]>2015-12-15 10:05:46 +0100
commit42b6156235421fbda1bc65c725e4ea7d183e4c84 (patch)
treede68b1d41dbdaf275b787184123eec0c10835899 /erts
parente56d78b761680d83ab61045a62d4fc7bdb312b3c (diff)
downloadotp-42b6156235421fbda1bc65c725e4ea7d183e4c84.tar.gz
otp-42b6156235421fbda1bc65c725e4ea7d183e4c84.tar.bz2
otp-42b6156235421fbda1bc65c725e4ea7d183e4c84.zip
erts: Fix large open_port arg segfault for win32
os_SUITE:large_output_command send a 10k large argument to open_port({spawn,""}) which was too small for the 2K buffer allocated for win32. The buffer is now dynamic and any size can be used.
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/sys/win32/sys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c
index 3793357848..76ce25916a 100644
--- a/erts/emulator/sys/win32/sys.c
+++ b/erts/emulator/sys/win32/sys.c
@@ -1526,8 +1526,8 @@ create_child_process
* Parse out the program name from the command line (it can be quoted and
* contain spaces).
*/
- newcmdline = (wchar_t *) erts_alloc(ERTS_ALC_T_TMP, 2048*sizeof(wchar_t));
cmdlength = parse_command(origcmd);
+ newcmdline = (wchar_t *) erts_alloc(ERTS_ALC_T_TMP, (MAX_PATH+wcslen(origcmd)-cmdlength)*sizeof(wchar_t));
thecommand = (wchar_t *) erts_alloc(ERTS_ALC_T_TMP, (cmdlength+1)*sizeof(wchar_t));
wcsncpy(thecommand, origcmd, cmdlength);
thecommand[cmdlength] = L'\0';