]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c
1) Initialize gBS, gST, gImageHandle in UefiBootServicesTableLib.c to NULL
[mirror_edk2.git] / MdePkg / Library / UefiBootServicesTableLib / UefiBootServicesTableLib.c
index 0db4707e292ffb56ce3e98ac50df5a827038f619..26f62f6c953220601d28e933a843f7eaa9aad7b3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Boot Services Table Library.\r
 \r
-  Copyright (c) 2006, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
   All rights reserved. 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
@@ -14,9 +14,9 @@
 \r
 **/\r
 \r
-EFI_HANDLE         gImageHandle;\r
-EFI_SYSTEM_TABLE   *gST;\r
-EFI_BOOT_SERVICES  *gBS;\r
+EFI_HANDLE         gImageHandle = NULL;\r
+EFI_SYSTEM_TABLE   *gST         = NULL;\r
+EFI_BOOT_SERVICES  *gBS         = NULL;\r
 \r
 /**\r
   The constructor function caches the pointer of Boot Services Table.\r
@@ -43,6 +43,7 @@ UefiBootServicesTableLibConstructor (
   // Cache the Image Handle\r
   //\r
   gImageHandle = ImageHandle;\r
+  ASSERT (gImageHandle != NULL);\r
 \r
   //\r
   // Cache pointer to the EFI System Table\r