[NTOSKRNL_VISTA lib]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 13 Jul 2016 16:43:16 +0000 (16:43 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 13 Jul 2016 16:43:16 +0000 (16:43 +0000)
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

reactos/sdk/lib/drivers/ntoskrnl_vista/rtl.c

index 0aed7ea..f8cab32 100644 (file)
@@ -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)
         {