Skip to content

Commit 78e9404

Browse files
authored
Update miniz_zip.c
Bugfix: MultiByteToWideChar() is being called with a byte count instead of a character count. This will cause a buffer overrun.
1 parent 963a27a commit 78e9404

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

miniz_zip.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static WCHAR* mz_utf8z_to_widechar(const char* str)
4848
{
4949
int reqChars = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);
5050
WCHAR* wStr = (WCHAR*)malloc(reqChars * sizeof(WCHAR));
51-
MultiByteToWideChar(CP_UTF8, 0, str, -1, wStr, sizeof(WCHAR) * reqChars);
51+
MultiByteToWideChar(CP_UTF8, 0, str, -1, wStr, reqChars);
5252
return wStr;
5353
}
5454

0 commit comments

Comments
 (0)