Commit 8385f137 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Don't free the DOS area when a broken app passes a NULL pointer to NtFreeVirtualMemory.

parent 2b2ee9c7
......@@ -1430,6 +1430,9 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
size = ROUND_SIZE( addr, size );
base = ROUND_ADDR( addr, page_mask );
/* avoid freeing the DOS area when a broken app passes a NULL pointer */
if (!base && !(type & MEM_SYSTEM)) return STATUS_INVALID_PARAMETER;
RtlEnterCriticalSection(&csVirtual);
if (!(view = VIRTUAL_FindView( base )) ||
......
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