Skip to content

Commit

Permalink
Check __wargv for null before accessing it
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Feb 14, 2025
1 parent 67b1a3a commit c14554f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ const PathNamePair &GetProcBinary()

fullpath.resize(len);
#else
if(__argc < 1 || !__wargv)
{
ERR("Failed to get process name: __argc = {}, __wargv = {}", __argc,
static_cast<void*>(__wargv));
return PathNamePair{};
}
const WCHAR *exePath{__wargv[0]};
if(!exePath)
{
Expand Down

0 comments on commit c14554f

Please sign in to comment.