diff options
author | Cinnamon Shia <cinnamon.shia@hpe.com> | 2016-11-02 10:40:34 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2016-11-03 11:00:52 +0800 |
commit | bfb4c2ba3742b61ef778e07957ff1b26b5a159b5 (patch) | |
tree | e5c378e8695b8f4729fff4f824c7dfb2b46c688b /MdeModulePkg/Universal/PCD/Pei | |
parent | 414b198be9c2065efda01cf43f7c86e41a449b4b (diff) | |
download | edk2-bfb4c2ba3742b61ef778e07957ff1b26b5a159b5.zip edk2-bfb4c2ba3742b61ef778e07957ff1b26b5a159b5.tar.gz edk2-bfb4c2ba3742b61ef778e07957ff1b26b5a159b5.tar.bz2 |
MdeModulePkg/PCD: Fix PcdGetNextToken may get a wrong PCD token
If there are two DynamicEx PCDs have the same PCD token number but
in different PCD token spaces, the PcdGetNextToken function may get
the wrong PCD token.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal/PCD/Pei')
-rw-r--r-- | MdeModulePkg/Universal/PCD/Pei/Pcd.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/MdeModulePkg/Universal/PCD/Pei/Pcd.c b/MdeModulePkg/Universal/PCD/Pei/Pcd.c index 7a486b7..668860b 100644 --- a/MdeModulePkg/Universal/PCD/Pei/Pcd.c +++ b/MdeModulePkg/Universal/PCD/Pei/Pcd.c @@ -2,13 +2,14 @@ All Pcd Ppi services are implemented here.
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
-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
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
+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
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -1116,13 +1117,17 @@ PeiPcdGetNextToken ( }
if (Found) {
+ //
+ // If given token number is PCD_INVALID_TOKEN_NUMBER, then return the first
+ // token number in found token space.
+ //
if (*TokenNumber == PCD_INVALID_TOKEN_NUMBER) {
*TokenNumber = ExMapTable[Index].ExTokenNumber;
return EFI_SUCCESS;
}
for ( ; Index < PeiPcdDb->ExTokenCount; Index++) {
- if (ExMapTable[Index].ExTokenNumber == *TokenNumber) {
+ if ((ExMapTable[Index].ExTokenNumber == *TokenNumber) && (ExMapTable[Index].ExGuidIndex == GuidTableIdx)) {
break;
}
}
|