Skip to content

Commit

Permalink
Fix a use-after-free in CreateProcessA (#54)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
  • Loading branch information
EstexNT and simonlindholm authored Oct 17, 2023
1 parent 90101d8 commit a829d0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dll/kernel32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a829d0d

Please sign in to comment.