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
This commit is contained in:
qhuang8
2009-02-16 02:07:32 +00:00
parent 13f0a970d2
commit 20bcdbcb69
3 changed files with 3 additions and 2 deletions

View File

@ -556,7 +556,7 @@ NotifyFwVolBlock (
// //
Status = CoreHandleProtocol (Handle, &gEfiFirmwareVolumeBlockProtocolGuid, (VOID **)&Fvb); Status = CoreHandleProtocol (Handle, &gEfiFirmwareVolumeBlockProtocolGuid, (VOID **)&Fvb);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
ASSERT (Fvb != NULL);
// //
// Make sure the Fv Header is O.K. // Make sure the Fv Header is O.K.

View File

@ -290,6 +290,7 @@ CoreOpenImageFile (
// //
// Allocate space for the file // Allocate space for the file
// //
ASSERT (FileInfo != NULL);
ImageFileHandle->Source = AllocatePool ((UINTN)FileInfo->FileSize); ImageFileHandle->Source = AllocatePool ((UINTN)FileInfo->FileSize);
if (ImageFileHandle->Source != NULL) { if (ImageFileHandle->Source != NULL) {
// //

View File

@ -580,8 +580,8 @@ CreateChildNode (
// Decompress the stream // Decompress the stream
// //
Status = CoreLocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **)&Decompress); Status = CoreLocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **)&Decompress);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
ASSERT (Decompress != NULL);
Status = Decompress->GetInfo ( Status = Decompress->GetInfo (
Decompress, Decompress,