Fix a use-after-free in CreateProcessA (#54)

Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
This commit is contained in:
EstexNT 2023-10-17 21:39:28 +03:00 committed by GitHub
parent 90101d8bc1
commit a829d0d58b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -214,7 +214,8 @@ namespace kernel32 {
char **argv = (char **) calloc(argc + 1, sizeof(char*));
argv[0] = wibo::executableName;
argv[1] = (char *) files::pathFromWindows(lpApplicationName).string().c_str();
std::string pathStr = files::pathFromWindows(lpApplicationName).string();
argv[1] = (char *) pathStr.c_str();
char* arg = strtok(lpCommandLine, " ");
size_t current_arg_index = 2;