mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[RTL] Allow RtlGetNextRange to be called on a finished iterator. CORE-6372
Fixes crash in kmtest:RtlRangeList.
This commit is contained in:
parent
9900089fa6
commit
2fb2f1e4c5
1 changed files with 10 additions and 0 deletions
|
@ -499,6 +499,12 @@ RtlGetNextRange(IN OUT PRTL_RANGE_LIST_ITERATOR Iterator,
|
|||
if (Iterator->Stamp != RangeList->Stamp)
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
||||
if (Iterator->Current == NULL)
|
||||
{
|
||||
*Range = NULL;
|
||||
return STATUS_NO_MORE_ENTRIES;
|
||||
}
|
||||
|
||||
if (MoveForwards)
|
||||
{
|
||||
Next = ((PRTL_RANGE_ENTRY)Iterator->Current)->Entry.Flink;
|
||||
|
@ -509,7 +515,11 @@ RtlGetNextRange(IN OUT PRTL_RANGE_LIST_ITERATOR Iterator,
|
|||
}
|
||||
|
||||
if (Next == Iterator->RangeListHead)
|
||||
{
|
||||
Iterator->Current = NULL;
|
||||
*Range = NULL;
|
||||
return STATUS_NO_MORE_ENTRIES;
|
||||
}
|
||||
|
||||
Iterator->Current = Next;
|
||||
*Range = &((PRTL_RANGE_ENTRY)Next)->Range;
|
||||
|
|
Loading…
Reference in a new issue