Module: wine Branch: master Commit: 6ecca8cf6307d3866b40a64577fe47db195ae9bf URL: https://gitlab.winehq.org/wine/wine/-/commit/6ecca8cf6307d3866b40a64577fe47d...
Author: Etaash Mathamsetty etaash.mathamsetty@gmail.com Date: Fri Jun 9 12:52:31 2023 -0400
ntdll: Allow RtlAllocateHeap to crash with invalid handle.
---
dlls/ntdll/heap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 921a51cf8b1..aca8e7181a8 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -2052,9 +2052,8 @@ void *WINAPI DECLSPEC_HOTPATCH RtlAllocateHeap( HANDLE handle, ULONG flags, SIZE ULONG heap_flags; NTSTATUS status;
- if (!(heap = unsafe_heap_from_handle( handle, flags, &heap_flags ))) - status = STATUS_INVALID_HANDLE; - else if ((block_size = heap_get_block_size( heap, heap_flags, size )) == ~0U) + heap = unsafe_heap_from_handle( handle, flags, &heap_flags ); + if ((block_size = heap_get_block_size( heap, heap_flags, size )) == ~0U) status = STATUS_NO_MEMORY; else if (block_size >= HEAP_MIN_LARGE_BLOCK_SIZE) status = heap_allocate_large( heap, heap_flags, block_size, size, &ptr );