Undefined result is due to RtlUnicodeToUTF8N() not setting output
length on error which is a correct behaviour according to
existing tests.
'Planet Zoo' is affected which passes NULL object name buffer to
NtCreateFile().
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
Supersedes 187879 - 187880.
dlls/ntdll/locale.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c
index d6bde700e42..4f03e3881f0 100644
--- a/dlls/ntdll/locale.c
+++ b/dlls/ntdll/locale.c
@@ -769,7 +769,7 @@ DWORD ntdll_umbstowcs( const char *src, DWORD srclen, WCHAR *dst, DWORD dstlen )
*/
int ntdll_wcstoumbs( const WCHAR *src, DWORD srclen, char *dst, DWORD dstlen, BOOL strict )
{
- DWORD i, reslen;
+ DWORD i, reslen = 0;
if (!unix_table.CodePage)
RtlUnicodeToUTF8N( dst, dstlen, &reslen, src, srclen * sizeof(WCHAR) );
--
2.26.2