]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPlatformStatusCode/Nt32/RtPlatformStatusCode.c
Add more check to make sure code run safely.
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Platform / Generic / RuntimeDxe / StatusCode / Lib / RtPlatformStatusCode / Nt32 / RtPlatformStatusCode.c
index 9ec2198d355a4c61f5bb428158886e7e00bbd11b..f4c64263945863055b89be51b26dc46e2d7e7168 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -133,11 +133,11 @@ Returns:
   // is connected.\r
   //\r
   mPeiReportStatusCode  = NULL;\r
-\r
+  Pointer               = NULL;\r
   Status                = EfiLibGetSystemConfigurationTable (&gEfiHobListGuid, &HobList);\r
   if (!EFI_ERROR (Status)) {\r
     Status = GetNextGuidHob (&HobList, &gEfiStatusCodeRuntimeProtocolGuid, &Pointer, NULL);\r
-    if (!EFI_ERROR (Status)) {\r
+    if (!EFI_ERROR (Status) && (Pointer != NULL)) {\r
       mPeiReportStatusCode = (EFI_REPORT_STATUS_CODE) (*(UINTN *) Pointer);\r
     }\r
   }\r