From 78e94043629aafddd38e49a53caea1ed7004cc5d Mon Sep 17 00:00:00 2001 From: jpcha2 <106297091+jpcha2@users.noreply.github.com> Date: Mon, 21 Nov 2022 04:36:20 +0300 Subject: [PATCH] Update miniz_zip.c Bugfix: MultiByteToWideChar() is being called with a byte count instead of a character count. This will cause a buffer overrun. --- miniz_zip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniz_zip.c b/miniz_zip.c index 75849af..2c09a11 100644 --- a/miniz_zip.c +++ b/miniz_zip.c @@ -48,7 +48,7 @@ static WCHAR* mz_utf8z_to_widechar(const char* str) { int reqChars = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0); WCHAR* wStr = (WCHAR*)malloc(reqChars * sizeof(WCHAR)); - MultiByteToWideChar(CP_UTF8, 0, str, -1, wStr, sizeof(WCHAR) * reqChars); + MultiByteToWideChar(CP_UTF8, 0, str, -1, wStr, reqChars); return wStr; }