File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -665,16 +665,21 @@ RtlpFindAndCommitPages(PHEAP Heap,
665
665
/* Calculate first and last entries */
666
666
FirstEntry = (PHEAP_ENTRY )Address ;
667
667
668
- /* Go through the entries to find the last one */
669
- if (PreviousUcr )
670
- LastEntry = (PHEAP_ENTRY )((ULONG_PTR )PreviousUcr -> Address + PreviousUcr -> Size );
671
- else
672
- LastEntry = & Segment -> Entry ;
673
-
674
- while (!(LastEntry -> Flags & HEAP_ENTRY_LAST_ENTRY ))
668
+ LastEntry = Segment -> LastEntryInSegment ;
669
+ if (!(LastEntry -> Flags & HEAP_ENTRY_LAST_ENTRY ) ||
670
+ LastEntry + LastEntry -> Size != FirstEntry )
675
671
{
676
- ASSERT (LastEntry -> Size != 0 );
677
- LastEntry += LastEntry -> Size ;
672
+ /* Go through the entries to find the last one */
673
+ if (PreviousUcr )
674
+ LastEntry = (PHEAP_ENTRY )((ULONG_PTR )PreviousUcr -> Address + PreviousUcr -> Size );
675
+ else
676
+ LastEntry = & Segment -> Entry ;
677
+
678
+ while (!(LastEntry -> Flags & HEAP_ENTRY_LAST_ENTRY ))
679
+ {
680
+ ASSERT (LastEntry -> Size != 0 );
681
+ LastEntry += LastEntry -> Size ;
682
+ }
678
683
}
679
684
ASSERT ((LastEntry + LastEntry -> Size ) == FirstEntry );
680
685
You can’t perform that action at this time.
0 commit comments