Commit 6ecca8cf authored by Etaash Mathamsetty's avatar Etaash Mathamsetty Committed by Alexandre Julliard

ntdll: Allow RtlAllocateHeap to crash with invalid handle.

parent 68a3b007
...@@ -2052,9 +2052,8 @@ void *WINAPI DECLSPEC_HOTPATCH RtlAllocateHeap( HANDLE handle, ULONG flags, SIZE ...@@ -2052,9 +2052,8 @@ void *WINAPI DECLSPEC_HOTPATCH RtlAllocateHeap( HANDLE handle, ULONG flags, SIZE
ULONG heap_flags; ULONG heap_flags;
NTSTATUS status; NTSTATUS status;
if (!(heap = unsafe_heap_from_handle( handle, flags, &heap_flags ))) heap = unsafe_heap_from_handle( handle, flags, &heap_flags );
status = STATUS_INVALID_HANDLE; if ((block_size = heap_get_block_size( heap, heap_flags, size )) == ~0U)
else if ((block_size = heap_get_block_size( heap, heap_flags, size )) == ~0U)
status = STATUS_NO_MEMORY; status = STATUS_NO_MEMORY;
else if (block_size >= HEAP_MIN_LARGE_BLOCK_SIZE) else if (block_size >= HEAP_MIN_LARGE_BLOCK_SIZE)
status = heap_allocate_large( heap, heap_flags, block_size, size, &ptr ); status = heap_allocate_large( heap, heap_flags, block_size, size, &ptr );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment