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

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Signed-off-by: Marcus Meissner <marcus@jet.franken.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ralf Habacker 2015-11-10 19:22:03 +01:00 committed by Alexandre Julliard
parent 61c49bd78e
commit 6018064d59
1 changed files with 7 additions and 1 deletions

View File

@ -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) if ((mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)
{ {
IMAGE_NT_HEADERS* nth = RtlImageNtHeader(mapping); IMAGE_NT_HEADERS* nth = RtlImageNtHeader(mapping);
if (!nth)
{
UnmapViewOfFile(mapping);
CloseHandle(hMap);
CloseHandle(hFile);
return FALSE;
}
matched++; matched++;
timestamp = nth->FileHeader.TimeDateStamp; timestamp = nth->FileHeader.TimeDateStamp;
size = nth->OptionalHeader.SizeOfImage; size = nth->OptionalHeader.SizeOfImage;