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
1 changed files with 6 additions and 1 deletions

View File

@ -187,7 +187,12 @@ BOOL WINAPI MapAndLoad(LPSTR pszImageName, LPSTR pszDllPath, PLOADED_IMAGE pLoad
goto Error; goto Error;
} }
pNtHeader = RtlImageNtHeader(mapping); if (!(pNtHeader = RtlImageNtHeader(mapping)))
{
WARN("Not an NT header\n");
UnmapViewOfFile(mapping);
goto Error;
}
pLoadedImage->ModuleName = HeapAlloc(GetProcessHeap(), 0, pLoadedImage->ModuleName = HeapAlloc(GetProcessHeap(), 0,
strlen(szFileName) + 1); strlen(szFileName) + 1);