[PATCH 2/3] winhttp: Pass correct buffer size to WideCharToMultiByte.
Hans Leidekker
hans at codeweavers.com
Wed Nov 20 07:29:07 CST 2019
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
dlls/winhttp/winhttp_private.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h
index 93cf0f7125..734a1ad52a 100644
--- a/dlls/winhttp/winhttp_private.h
+++ b/dlls/winhttp/winhttp_private.h
@@ -314,7 +314,7 @@ static inline WCHAR *strdupAW( const char *src )
WCHAR *dst = NULL;
if (src)
{
- DWORD len = MultiByteToWideChar( CP_ACP, 0, src, -1, NULL, 0 );
+ int len = MultiByteToWideChar( CP_ACP, 0, src, -1, NULL, 0 );
if ((dst = heap_alloc( len * sizeof(WCHAR) )))
MultiByteToWideChar( CP_ACP, 0, src, -1, dst, len );
}
@@ -341,7 +341,7 @@ static inline char *strdupWA_sized( const WCHAR *src, DWORD size )
int len = WideCharToMultiByte( CP_ACP, 0, src, size, NULL, 0, NULL, NULL ) + 1;
if ((dst = heap_alloc( len )))
{
- WideCharToMultiByte( CP_ACP, 0, src, len, dst, size, NULL, NULL );
+ WideCharToMultiByte( CP_ACP, 0, src, size, dst, len, NULL, NULL );
dst[len - 1] = 0;
}
}
--
2.20.1
More information about the wine-devel
mailing list