From 85d0b97d8d60fdcc740ae21f19c06ab0eeba9950 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Tue, 14 Apr 2015 08:54:11 +0000 Subject: MdeModulePkg Pcd: Check the input SkuId in SetSku() then GetSku() could return the currently active SkuId. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17173 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/PCD/Dxe/Service.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'MdeModulePkg/Universal/PCD/Dxe/Service.c') diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c index 7b0932a6e4..9b4701bdd7 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -2,7 +2,7 @@ Help functions used by PCD DXE driver. Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -147,6 +147,19 @@ GetPcdName ( CHAR8 *PcdName; CHAR8 *Name; + // + // Return NULL when PCD name table is absent. + // + if (IsPeiDb) { + if (mPcdDatabase.PeiDb->PcdNameTableOffset == 0) { + return NULL; + } + } else { + if (mPcdDatabase.DxeDb->PcdNameTableOffset == 0) { + return NULL; + } + } + // // TokenNumber Zero is reserved as PCD_INVALID_TOKEN_NUMBER. // We have to decrement TokenNumber by 1 to make it usable -- cgit v1.2.3