Add missing parameter checks to RtlAreBitsClear and RtlAreBitsSet

svn path=/trunk/; revision=55575
This commit is contained in:
Timo Kreuzer 2012-02-13 14:35:26 +00:00
parent 6c35ffefb5
commit 7a0cab18d0

View file

@ -365,6 +365,11 @@ RtlAreBitsClear(
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 @@ RtlAreBitsSet(
IN ULONG StartingIndex,
IN ULONG Length)
{
/* Verify parameters */
if ((StartingIndex + Length > BitMapHeader->SizeOfBitMap) ||
(StartingIndex + Length <= StartingIndex))
return FALSE;
return RtlpGetLengthOfRunSet(BitMapHeader, StartingIndex, Length) >= Length;
}