Author: gschneider
Date: Thu Oct 15 21:12:37 2009
New Revision: 43487
URL:
http://svn.reactos.org/svn/reactos?rev=43487&view=rev
Log:
[kernel32] IsBadStringPtrA/W:
- Remove overflow failure case, this isn't checked for string validation
- Adapt page check to let the full string be checked in case of overflow
See issue #4861 for more details.
Modified:
trunk/reactos/dll/win32/kernel32/mem/isbad.c
Modified: trunk/reactos/dll/win32/kernel32/mem/isbad.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/isb…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/mem/isbad.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/mem/isbad.c [iso-8859-1] Thu Oct 15 21:12:37 2009
@@ -171,9 +171,6 @@
/* Calculate the last page */
Last = (PWCHAR)((ULONG_PTR)lpsz + (ucchMax * 2) - 2);
- /* Another quick failure case */
- if ((ULONG_PTR)Last < (ULONG_PTR)lpsz) return TRUE;
-
/* Enter SEH */
_SEH2_TRY
{
@@ -184,7 +181,7 @@
{
Char = *Current;
Current++;
- } while (Char && (Current <= Last));
+ } while (Char && (Current != Last));
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -217,9 +214,6 @@
/* Calculate the last page */
Last = (PCHAR)((ULONG_PTR)lpsz + ucchMax - 1);
- /* Another quick failure case */
- if ((ULONG_PTR)Last < (ULONG_PTR)lpsz) return TRUE;
-
/* Enter SEH */
_SEH2_TRY
{
@@ -230,7 +224,7 @@
{
Char = *Current;
Current++;
- } while (Char && (Current <= Last));
+ } while (Char && (Current != Last));
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{