Eric Pouech : imagehlp: Correctly handle files without NT headers in MapAndLoad.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jan 4 15:09:32 CST 2007


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

Author: Eric Pouech <eric.pouech at wanadoo.fr>
Date:   Wed Jan  3 14:39:33 2007 +0100

imagehlp: Correctly handle files without NT headers in MapAndLoad.

---

 dlls/imagehlp/access.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dlls/imagehlp/access.c b/dlls/imagehlp/access.c
index f7f352d..51ec161 100644
--- a/dlls/imagehlp/access.c
+++ b/dlls/imagehlp/access.c
@@ -187,7 +187,12 @@ BOOL WINAPI MapAndLoad(LPSTR pszImageNam
         goto Error;
     }
 
-    pNtHeader = RtlImageNtHeader(mapping);
+    if (!(pNtHeader = RtlImageNtHeader(mapping)))
+    {
+        WARN("Not an NT header\n");
+        UnmapViewOfFile(mapping);
+        goto Error;
+    }
 
     pLoadedImage->ModuleName       = HeapAlloc(GetProcessHeap(), 0,
                                                strlen(szFileName) + 1);




More information about the wine-cvs mailing list