From dee9a361c74d150bd04017bcc938ec49d8f5fb27 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 14 Apr 2022 09:44:41 +0200 Subject: [PATCH] user32: Pass a valid length to RtlUnicodeToMultiByteN/RtlMultiByteToUnicodeN. Signed-off-by: Alexandre Julliard --- dlls/user32/winproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index 7b9b2000c06..9e90906bc5d 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -373,7 +373,7 @@ LRESULT WINPROC_CallProcAtoW( winproc_callback_t callback, HWND hwnd, UINT msg, if (*result >= 0) { DWORD len; - RtlUnicodeToMultiByteN( (LPSTR)lParam, ~0u, &len, + RtlUnicodeToMultiByteN( (LPSTR)lParam, 512 * 3, &len, buffer, (lstrlenW(buffer) + 1) * sizeof(WCHAR) ); *result = len - 1; } @@ -633,7 +633,7 @@ static LRESULT WINPROC_CallProcWtoA( winproc_callback_t callback, HWND hwnd, UIN if (*result >= 0) { DWORD len; - RtlMultiByteToUnicodeN( (LPWSTR)lParam, ~0u, &len, buffer, strlen(buffer) + 1 ); + RtlMultiByteToUnicodeN( (LPWSTR)lParam, 512 * 3, &len, buffer, strlen(buffer) + 1 ); *result = len / sizeof(WCHAR) - 1; } }