diff options
author | Lukas Larsson <[email protected]> | 2015-10-12 14:59:37 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2015-12-15 10:05:46 +0100 |
commit | 42b6156235421fbda1bc65c725e4ea7d183e4c84 (patch) | |
tree | de68b1d41dbdaf275b787184123eec0c10835899 /erts/emulator/sys/win32 | |
parent | e56d78b761680d83ab61045a62d4fc7bdb312b3c (diff) | |
download | otp-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/emulator/sys/win32')
-rw-r--r-- | erts/emulator/sys/win32/sys.c | 2 |
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'; |