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

Alexandre Julliard julliard at wine.codeweavers.com
Fri Dec 1 06:28:31 CST 2006


Module: wine
Branch: master
Commit: 8385f137b50242c632bd8f91a495a2b7e5adfee4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8385f137b50242c632bd8f91a495a2b7e5adfee4

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Dec  1 11:38:52 2006 +0100

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

---

 dlls/ntdll/virtual.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index c62390a..573072e 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1430,6 +1430,9 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HAN
     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 )) ||




More information about the wine-cvs mailing list