mirror of
https://github.com/php/php-src.git
synced 2026-03-27 09:42:22 +01:00
- Fix off by one error in allocating command line (by Shane)
This commit is contained in:
@@ -135,7 +135,7 @@ TSRM_API FILE* popen(const char *command, const char *type)
|
||||
startup.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
}
|
||||
|
||||
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+4);
|
||||
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c "));
|
||||
sprintf(cmd, "%s /c %s", TWG(comspec), command);
|
||||
if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS, NULL, NULL, &startup, &process)) {
|
||||
return NULL;
|
||||
@@ -184,4 +184,4 @@ TSRM_API int pclose(FILE* stream)
|
||||
return termstat;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user