mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +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:
parent
f55e4a2843
commit
459110618d
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue