Author: fireball
Date: Tue Oct 13 20:01:55 2009
New Revision: 43438
URL:
http://svn.reactos.org/svn/reactos?rev=43438&view=rev
Log:
[rtl]
- Fix an out-of-bounds read in RtlpDidUnicodeToOemWorked.
See issue #4888 for more details.
Modified:
trunk/reactos/lib/rtl/unicode.c
Modified: trunk/reactos/lib/rtl/unicode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/unicode.c?rev=4343…
==============================================================================
--- trunk/reactos/lib/rtl/unicode.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/unicode.c [iso-8859-1] Tue Oct 13 20:01:55 2009
@@ -417,12 +417,12 @@
ULONG i = 0;
/* Go through all characters of a string */
- while ((OemString->Buffer[i] != 0) &&
- (i < OemString->Length))
+ while (i < OemString->Length)
{
/* Check if it got translated into '?', but source char
wasn't '?' equivalent */
- if ((OemString->Buffer[i] == NlsOemDefaultChar) &&
+ if ((OemString->Buffer[i] != 0) &&
+ (OemString->Buffer[i] == NlsOemDefaultChar) &&
(UnicodeString->Buffer[i] != NlsUnicodeDefaultChar))
{
/* Yes, it means unmappable characters were found */