]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add more checkpoint for deference pointer.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 23 Jan 2009 04:45:48 +0000 (04:45 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 23 Jan 2009 04:45:48 +0000 (04:45 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7350 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/GenericBdsLib/BdsBoot.c
MdeModulePkg/Library/GenericBdsLib/BdsMisc.c

index 953086c7d3b337458d0d83bb2565f13a5a510719..d273e3f6042ead6f6bdd646fa932a19c4dc44b93 100644 (file)
@@ -411,7 +411,7 @@ BdsExpandPartitionPartialDevicePathToFull (
   //\r
   BdsLibConnectAllDriversToAllControllers ();\r
   Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiBlockIoProtocolGuid, NULL, &BlockIoHandleCount, &BlockIoBuffer);\r
-  if (EFI_ERROR (Status) || BlockIoHandleCount == 0) {\r
+  if (EFI_ERROR (Status) || BlockIoHandleCount == 0 || BlockIoBuffer == NULL) {\r
     //\r
     // If there was an error or there are no device handles that support\r
     // the BLOCK_IO Protocol, then return.\r
index b9e6ae7ef33f31d9c4bfc13b8438dbb8b12de840..acf61ebcb6627a371ee3d466a7bd06fb0ad83743 100644 (file)
@@ -1170,7 +1170,7 @@ BdsSetMemoryTypeInformationVariable (
              &gEfiMemoryTypeInformationGuid,\r
              (VOID **) &CurrentMemoryTypeInformation\r
              );\r
-  if (EFI_ERROR (Status)) {\r
+  if (EFI_ERROR (Status) || CurrentMemoryTypeInformation == NULL) {\r
     return;\r
   }\r
 \r