mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
[RTL]
Add missing parameter checks to RtlAreBitsClear and RtlAreBitsSet svn path=/trunk/; revision=55575
This commit is contained in:
parent
6c35ffefb5
commit
7a0cab18d0
1 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue