summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BasePeCoffLib
diff options
context:
space:
mode:
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-31 07:24:49 +0000
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-31 07:24:49 +0000
commit03bd58dc4b249596d541b3ac254e3a03c5bdb05c (patch)
treedd56e05d1ff099c57a0fc6801defe8f12f7a63d9 /MdePkg/Library/BasePeCoffLib
parent6160c6283510ce63ddd5abc306770bc90b81e4c3 (diff)
downloadedk2-platforms-03bd58dc4b249596d541b3ac254e3a03c5bdb05c.tar.xz
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
Diffstat (limited to 'MdePkg/Library/BasePeCoffLib')
-rw-r--r--MdePkg/Library/BasePeCoffLib/BasePeCoff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
index 60f0470319..a534f52236 100644
--- a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
+++ b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
@@ -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 +