From: Hermès Bélusca-Maïto Date: Wed, 13 Jul 2016 16:43:16 +0000 (+0000) Subject: [NTOSKRNL_VISTA lib] X-Git-Tag: ReactOS-0.4.2~88 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=341b360aa5095354afb42c7df8c3e0b7ef6b8fbf [NTOSKRNL_VISTA lib] Initialize utf8_ch_len to zero before using it (at each turn of the for-loop). As I couldn't find this code in Wine, I couldn't see whether they already fixed it or not. Caught by Victor. CORE-11596 svn path=/trunk/; revision=71928 --- diff --git a/reactos/sdk/lib/drivers/ntoskrnl_vista/rtl.c b/reactos/sdk/lib/drivers/ntoskrnl_vista/rtl.c index 0aed7ea1351..f8cab32cdd7 100644 --- a/reactos/sdk/lib/drivers/ntoskrnl_vista/rtl.c +++ b/reactos/sdk/lib/drivers/ntoskrnl_vista/rtl.c @@ -72,6 +72,9 @@ NTSTATUS NTAPI RtlUnicodeToUTF8N(CHAR *utf8_dest, ULONG utf8_bytes_max, /* encode ch as UTF-8 */ #ifndef __REACTOS__ assert(ch <= 0x10ffff); +#endif +#ifdef __REACTOS__ + utf8_ch_len = 0; // FIXME: Check whether a non-zero value might be better for the case ch >= 0x200000 ? #endif if (ch < 0x80) {