Commit 4950d3de authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

imagehlp: Correctly handle files without NT headers in MapAndLoad.

parent 5dbb2517
......@@ -187,7 +187,12 @@ BOOL WINAPI MapAndLoad(LPSTR pszImageName, LPSTR pszDllPath, PLOADED_IMAGE pLoad
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment