diff options
author | Pierre Joye <pajoye@php.net> | 2011-07-27 14:23:06 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2011-07-27 14:23:06 +0000 |
commit | b2e3d0abd53375b0dbdacb74b9444c365ea997b3 (patch) | |
tree | 335fc486a5953d8c251533dac275bea1c23d1085 /TSRM | |
parent | 0beb0e7056302449aa3423327f5bec7ccd47b3be (diff) | |
download | php-git-b2e3d0abd53375b0dbdacb74b9444c365ea997b3.tar.gz |
- Fix #55295, check if malloc failed
Diffstat (limited to 'TSRM')
-rw-r--r-- | TSRM/tsrm_win32.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index 6031cc29da..d49506636f 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -530,6 +530,10 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, } cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2); + if (!cmd) { + return NULL; + } + sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command); if (asuser) { res = CreateProcessAsUser(token_user, NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process); |