ntdll: Fix tail padding in mark_block_tail().

This commit is contained in:
Paul Gofman 2023-05-11 21:57:52 -06:00 committed by Alexandre Julliard
parent c8362ef8d1
commit 0fc9a9e426
2 changed files with 2 additions and 3 deletions

View file

@ -3127,7 +3127,6 @@ static void test_block_layout( HANDLE heap, DWORD global_flags, DWORD heap_flags
ok( !memcmp( ptr1 + alloc_size, tail_buf, tail_size ), "missing block tail\n" );
ok( !memcmp( ptr2 + alloc_size, tail_buf, tail_size ), "missing block tail\n" );
todo_wine_if( global_flags & FLG_HEAP_ENABLE_FREE_CHECK )
ok( !memcmp( ptr0 + alloc_size + tail_size, padd_buf, 2 * sizeof(void *) ), "unexpected padding\n" );
tmp_ptr = (void *)0xdeadbeef;

View file

@ -500,8 +500,8 @@ static inline void mark_block_tail( struct block *block, DWORD flags )
if (flags & HEAP_ADD_USER_INFO)
{
if (flags & HEAP_TAIL_CHECKING_ENABLED || RUNNING_ON_VALGRIND) tail += BLOCK_ALIGN;
valgrind_make_writable( tail + sizeof(void *), sizeof(void *) );
memset( tail + sizeof(void *), 0, sizeof(void *) );
valgrind_make_writable( tail, BLOCK_ALIGN );
memset( tail, 0, BLOCK_ALIGN );
}
}