Browse Source

Utility: Fied possible stack buffer overrun in `ComputeFileHash2`

pull/886/head
Valentin Radu 4 years ago
parent
commit
19ef6988b6
  1. 2
      ExplorerPatcher/utility.c

2
ExplorerPatcher/utility.c

@ -430,7 +430,7 @@ int ComputeFileHash2(HMODULE hModule, LPCWSTR filename, LPSTR hash, DWORD dwHash @@ -430,7 +430,7 @@ int ComputeFileHash2(HMODULE hModule, LPCWSTR filename, LPSTR hash, DWORD dwHash
char real_hash[33];
ComputeFileHash(filename, real_hash, 33);
strncpy_s(hash + strlen(hash), dwHash, real_hash, 32 - strlen(hash));
strncpy_s(hash + strlen(hash), dwHash - strlen(hash), real_hash, 32 - strlen(hash));
hash[33] = 0;
return ERROR_SUCCESS;

Loading…
Cancel
Save