Growtopia crashes if we don't raise an exception with a NULL handle.
From: Etaash Mathamsetty 45927311+Etaash-mathamsetty@users.noreply.github.com
--- dlls/ntdll/heap.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 921a51cf8b1..f65597e159e 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -2052,6 +2052,13 @@ void *WINAPI DECLSPEC_HOTPATCH RtlAllocateHeap( HANDLE handle, ULONG flags, SIZE ULONG heap_flags; NTSTATUS status;
+ /* Some applications (e.g Growtopia) rely on this behavior */ + if (!handle) + { + RtlRaiseStatus(STATUS_ACCESS_VIOLATION); + return NULL; + } + 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)
Couldn't you simply let it crash naturally by accessing null pointers?
On Fri Jun 9 17:24:41 2023 +0000, Nikolay Sivov wrote:
Couldn't you simply let it crash naturally by accessing null pointers?
let me try that