From 20bcdbcb69a63df43d897b51634a38df4e261b49 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Mon, 16 Feb 2009 02:07:32 +0000 Subject: [PATCH] Add assertion to ensure pointer dereference has been checked against NULL pointer. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7528 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Dxe/FwVol/FwVol.c | 2 +- MdeModulePkg/Core/Dxe/Image/ImageFile.c | 1 + MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c b/MdeModulePkg/Core/Dxe/FwVol/FwVol.c index 2829092e17..f2451b03bf 100644 --- a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Dxe/FwVol/FwVol.c @@ -556,7 +556,7 @@ NotifyFwVolBlock ( // Status = CoreHandleProtocol (Handle, &gEfiFirmwareVolumeBlockProtocolGuid, (VOID **)&Fvb); ASSERT_EFI_ERROR (Status); - + ASSERT (Fvb != NULL); // // Make sure the Fv Header is O.K. diff --git a/MdeModulePkg/Core/Dxe/Image/ImageFile.c b/MdeModulePkg/Core/Dxe/Image/ImageFile.c index 453e88b940..b132cf49d5 100644 --- a/MdeModulePkg/Core/Dxe/Image/ImageFile.c +++ b/MdeModulePkg/Core/Dxe/Image/ImageFile.c @@ -290,6 +290,7 @@ CoreOpenImageFile ( // // Allocate space for the file // + ASSERT (FileInfo != NULL); ImageFileHandle->Source = AllocatePool ((UINTN)FileInfo->FileSize); if (ImageFileHandle->Source != NULL) { // diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c index d2c40049d2..2dcad4e3d5 100644 --- a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c +++ b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c @@ -580,8 +580,8 @@ CreateChildNode ( // Decompress the stream // Status = CoreLocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **)&Decompress); - ASSERT_EFI_ERROR (Status); + ASSERT (Decompress != NULL); Status = Decompress->GetInfo ( Decompress,