- ASSERT on damaged heap data structures instead of producing an infinite loop
See issue #5857 for more details.

svn path=/trunk/; revision=54749
This commit is contained in:
Thomas Faber 2011-12-24 22:45:26 +00:00
parent 42942c9fbe
commit aa885e24d7

View file

@ -669,6 +669,7 @@ RtlpFindAndCommitPages(PHEAP Heap,
while (!(LastEntry->Flags & HEAP_ENTRY_LAST_ENTRY))
{
ASSERT(LastEntry->Size != 0);
LastEntry += LastEntry->Size;
}
ASSERT((LastEntry + LastEntry->Size) == FirstEntry);
@ -683,7 +684,7 @@ RtlpFindAndCommitPages(PHEAP Heap,
DPRINT("Updating UcrDescriptor %p, new Address %p, size %d\n",
UcrDescriptor, UcrDescriptor->Address, UcrDescriptor->Size);
/* Set various first entry fields*/
/* Set various first entry fields */
FirstEntry->SegmentOffset = LastEntry->SegmentOffset;
FirstEntry->Size = (USHORT)(*Size >> HEAP_ENTRY_SHIFT);
FirstEntry->PreviousSize = LastEntry->Size;