Add some ASSERT()s to avoid NULL reference.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7162 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
gikidy 2008-12-31 07:24:49 +00:00
parent 6160c62835
commit 03bd58dc4b
1 changed files with 3 additions and 0 deletions

View File

@ -588,10 +588,12 @@ PeCoffLoaderRelocateImage (
if (NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
RelocBase = PeCoffLoaderImageAddress (ImageContext, RelocDir->VirtualAddress);
ASSERT(RelocBase != NULL);
RelocBaseEnd = PeCoffLoaderImageAddress (
ImageContext,
RelocDir->VirtualAddress + RelocDir->Size - 1
);
ASSERT(RelocBaseEnd !=NULL);
} else {
//
// Set base and end to bypass processing below.
@ -626,6 +628,7 @@ PeCoffLoaderRelocateImage (
RelocEnd = (UINT16 *) ((CHAR8 *) RelocBase + RelocBase->SizeOfBlock);
if (!(ImageContext->IsTeImage)) {
FixupBase = PeCoffLoaderImageAddress (ImageContext, RelocBase->VirtualAddress);
ASSERT(FixupBase != NULL);
} else {
FixupBase = (CHAR8 *)(UINTN)(ImageContext->ImageAddress +
RelocBase->VirtualAddress +