From: Alfred Agrell floating@muncher.se
--- dlls/ntdll/locale_private.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/locale_private.h b/dlls/ntdll/locale_private.h index 40d6ab0004d..3f82129790a 100644 --- a/dlls/ntdll/locale_private.h +++ b/dlls/ntdll/locale_private.h @@ -443,7 +443,11 @@ static inline NTSTATUS utf8_mbstowcs( WCHAR *dst, unsigned int dstlen, unsigned { res -= 0x10000; *dst++ = 0xd800 | (res >> 10); - if (dst == dstend) break; + if (dst == dstend) + { + status = STATUS_BUFFER_TOO_SMALL; + break; + } *dst++ = 0xdc00 | (res & 0x3ff); } else