]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/PCD/Pei/Service.c
MdeModulePkg Pcd: Check the input SkuId in SetSku()
[mirror_edk2.git] / MdeModulePkg / Universal / PCD / Pei / Service.c
index af40db8319c39489ef65cd1717838ef17cad5de4..83309a6f392fe4e6acbd5e62bafa61421595654b 100644 (file)
@@ -2,7 +2,7 @@
   The driver internal functions are implmented here.\r
   They build Pei PCD database, and provide access service to PCD database.\r
 \r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2015, 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
@@ -112,6 +112,13 @@ GetPcdName (
   CHAR8             *PcdName;\r
   CHAR8             *Name;\r
 \r
+  //\r
+  // Return NULL when PCD name table is absent. \r
+  //\r
+  if (Database->PcdNameTableOffset == 0) {\r
+    return NULL;\r
+  }\r
+\r
   //\r
   // TokenNumber Zero is reserved as PCD_INVALID_TOKEN_NUMBER.\r
   // We have to decrement TokenNumber by 1 to make it usable\r