From 485a505713dc6ff97c26fd8b289b1ecc847e5699 Mon Sep 17 00:00:00 2001 From: klu2 Date: Fri, 23 Jan 2009 04:45:48 +0000 Subject: [PATCH] Add more checkpoint for deference pointer. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7350 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Library/GenericBdsLib/BdsBoot.c | 2 +- MdeModulePkg/Library/GenericBdsLib/BdsMisc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c b/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c index 953086c7d3..d273e3f604 100644 --- a/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c +++ b/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c @@ -411,7 +411,7 @@ BdsExpandPartitionPartialDevicePathToFull ( // BdsLibConnectAllDriversToAllControllers (); Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiBlockIoProtocolGuid, NULL, &BlockIoHandleCount, &BlockIoBuffer); - if (EFI_ERROR (Status) || BlockIoHandleCount == 0) { + if (EFI_ERROR (Status) || BlockIoHandleCount == 0 || BlockIoBuffer == NULL) { // // If there was an error or there are no device handles that support // the BLOCK_IO Protocol, then return. diff --git a/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c b/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c index b9e6ae7ef3..acf61ebcb6 100644 --- a/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c +++ b/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c @@ -1170,7 +1170,7 @@ BdsSetMemoryTypeInformationVariable ( &gEfiMemoryTypeInformationGuid, (VOID **) &CurrentMemoryTypeInformation ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR (Status) || CurrentMemoryTypeInformation == NULL) { return; }