Author: tkreuzer
Date: Mon Feb 13 14:35:26 2012
New Revision: 55575
URL:
http://svn.reactos.org/svn/reactos?rev=55575&view=rev
Log:
[RTL]
Add missing parameter checks to RtlAreBitsClear and RtlAreBitsSet
Modified:
trunk/reactos/lib/rtl/bitmap.c
Modified: trunk/reactos/lib/rtl/bitmap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/bitmap.c?rev=55575…
==============================================================================
--- trunk/reactos/lib/rtl/bitmap.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/bitmap.c [iso-8859-1] Mon Feb 13 14:35:26 2012
@@ -365,6 +365,11 @@
IN ULONG StartingIndex,
IN ULONG Length)
{
+ /* Verify parameters */
+ if ((StartingIndex + Length > BitMapHeader->SizeOfBitMap) ||
+ (StartingIndex + Length <= StartingIndex))
+ return FALSE;
+
return RtlpGetLengthOfRunClear(BitMapHeader, StartingIndex, Length) >= Length;
}
@@ -375,6 +380,11 @@
IN ULONG StartingIndex,
IN ULONG Length)
{
+ /* Verify parameters */
+ if ((StartingIndex + Length > BitMapHeader->SizeOfBitMap) ||
+ (StartingIndex + Length <= StartingIndex))
+ return FALSE;
+
return RtlpGetLengthOfRunSet(BitMapHeader, StartingIndex, Length) >= Length;
}