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

This commit is contained in:
Alexandre Julliard 2006-12-01 11:38:52 +01:00
parent 2b2ee9c7d1
commit 8385f137b5
1 changed files with 3 additions and 0 deletions

View File

@ -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 )) ||