Utility: Fied possible stack buffer overrun in ComputeFileHash2

This commit is contained in:
Valentin Radu
2022-02-17 22:50:44 +02:00
parent d5b63319f0
commit 19ef6988b6
+1 -1
View File
@@ -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;