mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
Prevent accessing NULL as a PE header when we have a bad file, found with Stefan100's help
svn path=/trunk/; revision=38801
This commit is contained in:
@@ -481,6 +481,11 @@ FrLdrReadAndMapImage(IN FILE *Image,
|
||||
|
||||
/* Get image headers */
|
||||
NtHeader = RtlImageNtHeader(ReadBuffer);
|
||||
if (!NtHeader)
|
||||
{
|
||||
DbgPrint("Failed to read image (bad PE signature) %s\n", Name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Allocate memory for the driver */
|
||||
ImageSize = NtHeader->OptionalHeader.SizeOfImage;
|
||||
|
||||
Reference in New Issue
Block a user