Skip to content

Commit

Permalink
Fixed a buffer allocation bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
al45tair committed Jan 1, 2020
1 parent d467aee commit d0c26df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ArgxFindExecutable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ ArgxFindExecutableW(LPCWSTR lpszArgv0)

// If it has a path, return a copy of the string as-is
if (hasPath) {
LPWSTR pszResult = (LPWSTR)LocalAlloc(LMEM_FIXED, len + 1);
LPWSTR pszResult = (LPWSTR)LocalAlloc(LMEM_FIXED, (len + 1) * sizeof(WCHAR));
CopyMemory(pszResult, lpszArgv0, (len + 1) * sizeof(WCHAR));
return pszResult;
}
Expand Down

0 comments on commit d0c26df

Please sign in to comment.