Commit 5b4cfac3 authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

ntdll: Take size of the arena from the current pointer before advancing.

parent 53c05cb5
...@@ -1613,7 +1613,19 @@ NTSTATUS WINAPI RtlWalkHeap( HANDLE heap, PVOID entry_ptr ) ...@@ -1613,7 +1613,19 @@ NTSTATUS WINAPI RtlWalkHeap( HANDLE heap, PVOID entry_ptr )
goto HW_end; goto HW_end;
} }
if (((ARENA_INUSE *)ptr - 1)->magic == ARENA_INUSE_MAGIC)
{
ARENA_INUSE *pArena = (ARENA_INUSE *)ptr - 1;
ptr += pArena->size & ARENA_SIZE_MASK;
}
else if (((ARENA_FREE *)ptr - 1)->magic == ARENA_FREE_MAGIC)
{
ARENA_FREE *pArena = (ARENA_FREE *)ptr - 1;
ptr += pArena->size & ARENA_SIZE_MASK;
}
else
ptr += entry->cbData; /* point to next arena */ ptr += entry->cbData; /* point to next arena */
if (ptr > (char *)currentheap + currentheap->size - 1) if (ptr > (char *)currentheap + currentheap->size - 1)
{ /* proceed with next subheap */ { /* proceed with next subheap */
if (!(currentheap = currentheap->next)) if (!(currentheap = currentheap->next))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment