mirror of https://github.com/acidanthera/audk.git
Add check for the validity of resource directory address.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8164 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
55a1bb43aa
commit
50cd68dfb5
|
@ -67,7 +67,7 @@ PeCoffLoaderGetPeHeader (
|
|||
UINT16 Magic;
|
||||
|
||||
//
|
||||
// Read the DOS image header to check for it's existance
|
||||
// Read the DOS image header to check for its existence
|
||||
//
|
||||
Size = sizeof (EFI_IMAGE_DOS_HEADER);
|
||||
Status = ImageContext->ImageRead (
|
||||
|
@ -1169,7 +1169,7 @@ PeCoffLoaderLoadImage (
|
|||
|
||||
if (DirectoryEntry->Size != 0) {
|
||||
Base = PeCoffLoaderImageAddress (ImageContext, DirectoryEntry->VirtualAddress);
|
||||
|
||||
if (Base != NULL) {
|
||||
ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) Base;
|
||||
ResourceDirectoryEntry = (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *) (ResourceDirectory + 1);
|
||||
|
||||
|
@ -1210,11 +1210,11 @@ PeCoffLoaderLoadImage (
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
ResourceDirectoryEntry++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue