]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
ShellPkg: Initialize the local pointer to avoid potential suspicious dereference.
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / Mm.c
index 3f08cc84dc244f4c70a974eae94b8b56a0e1f9e9..7b26e4d27f6e3eb3250a91c029b88302eb4a8c52 100644 (file)
@@ -317,6 +317,7 @@ ShellMmLocateIoProtocol (
   }\r
 \r
   *PciRootBridgeIo = NULL;\r
+  HandleBuffer     = NULL;\r
   Status = gBS->LocateHandleBuffer (\r
                   ByProtocol,\r
                   &gEfiPciRootBridgeIoProtocolGuid,\r
@@ -324,7 +325,7 @@ ShellMmLocateIoProtocol (
                   &HandleCount,\r
                   &HandleBuffer\r
                   );\r
-  if (EFI_ERROR (Status) || (HandleCount == 0)) {\r
+  if (EFI_ERROR (Status) || (HandleCount == 0) || (HandleBuffer == NULL)) {\r
     return FALSE;\r
   }\r
 \r