mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-29 19:26:33 +00:00
[RTL]
- Fix apitest crashes in RtlFindClearBits/RtlFindSetBits svn path=/trunk/; revision=62691
This commit is contained in:
@@ -101,6 +101,11 @@ RtlpGetLengthOfRunClear(
|
||||
BITMAP_INDEX Value, BitPos, Length;
|
||||
PBITMAP_BUFFER Buffer, MaxBuffer;
|
||||
|
||||
/* If we are already at the end, the length of the run is zero */
|
||||
ASSERT(StartingIndex <= BitMapHeader->SizeOfBitMap);
|
||||
if (StartingIndex >= BitMapHeader->SizeOfBitMap)
|
||||
return 0;
|
||||
|
||||
/* Calculate positions */
|
||||
Buffer = BitMapHeader->Buffer + StartingIndex / _BITCOUNT;
|
||||
BitPos = StartingIndex & (_BITCOUNT - 1);
|
||||
@@ -150,6 +155,11 @@ RtlpGetLengthOfRunSet(
|
||||
BITMAP_INDEX InvValue, BitPos, Length;
|
||||
PBITMAP_BUFFER Buffer, MaxBuffer;
|
||||
|
||||
/* If we are already at the end, the length of the run is zero */
|
||||
ASSERT(StartingIndex <= BitMapHeader->SizeOfBitMap);
|
||||
if (StartingIndex >= BitMapHeader->SizeOfBitMap)
|
||||
return 0;
|
||||
|
||||
/* Calculate positions */
|
||||
Buffer = BitMapHeader->Buffer + StartingIndex / _BITCOUNT;
|
||||
BitPos = StartingIndex & (_BITCOUNT - 1);
|
||||
|
||||
Reference in New Issue
Block a user