imagehlp: Correctly handle files without NT headers in MapAndLoad.

This commit is contained in:
Eric Pouech 2007-01-03 14:39:33 +01:00 committed by Alexandre Julliard
parent 5dbb25170e
commit 4950d3deb2

View file

@ -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);