Ralf Habacker : dbghelp: Fix crash in module_find_cb on trying to parse non image files.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Nov 11 08:36:43 CST 2015


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

Author: Ralf Habacker <ralf.habacker at freenet.de>
Date:   Tue Nov 10 19:22:03 2015 +0100

dbghelp: Fix crash in module_find_cb on trying to parse non image files.

Signed-off-by: Ralf Habacker <ralf.habacker at freenet.de>
Signed-off-by: Marcus Meissner <marcus at jet.franken.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dbghelp/path.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c
index a0e51bd..8c74426 100644
--- a/dlls/dbghelp/path.c
+++ b/dlls/dbghelp/path.c
@@ -490,7 +490,13 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
                 if ((mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)
                 {
                     IMAGE_NT_HEADERS*   nth = RtlImageNtHeader(mapping);
-
+                    if (!nth)
+                    {
+                        UnmapViewOfFile(mapping);
+                        CloseHandle(hMap);
+                        CloseHandle(hFile);
+                        return FALSE;
+                    }
                     matched++;
                     timestamp = nth->FileHeader.TimeDateStamp;
                     size = nth->OptionalHeader.SizeOfImage;




More information about the wine-cvs mailing list