ntdll: Avoid shrinking large heap block to small block.

Even though this is a waste of memory it seems to trip on some UAF with
some games.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54475
This commit is contained in:
Rémi Bernon 2023-02-20 14:20:20 +01:00 committed by Alexandre Julliard
parent 26c1edf4b2
commit 63fb16338c

View file

@ -2092,7 +2092,6 @@ static NTSTATUS heap_resize_large( struct heap *heap, ULONG flags, struct block
SIZE_T old_block_size = large->block_size;
*old_size = large->data_size;
if (block_size < HEAP_MIN_LARGE_BLOCK_SIZE / 4) return STATUS_NO_MEMORY; /* shrinking large block to small block */
if (old_block_size < block_size) return STATUS_NO_MEMORY;
/* FIXME: we could remap zero-pages instead */