Commit dee9a361 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Pass a valid length to RtlUnicodeToMultiByteN/RtlMultiByteToUnicodeN.

parent 1f71ea31
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment