[PATCH v2 0/1] MR3030: ntdll: Raise exception when handle is NULL in RtlAllocateHeap.
Growtopia crashes if we don't raise an exception with a NULL handle. -- v2: ntdll: Allow RtlAllocateHeap to crash with invalid handle. https://gitlab.winehq.org/wine/wine/-/merge_requests/3030
From: Etaash Mathamsetty <45927311+Etaash-mathamsetty(a)users.noreply.github.com> --- 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 ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3030
On Fri Jun 9 17:24:41 2023 +0000, Etaash Mathamsetty wrote:
let me try that Seems to work still :)
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3030#note_35288
participants (2)
-
Etaash Mathamsetty -
Etaash Mathamsetty (@etaash.mathamsetty)