summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Universal/PCD/Pei
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-06 13:34:25 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-06 13:34:25 +0000
commit2b21a9713ce974c14f26dfb5d3496372e04b501b (patch)
treeb83008e7480ff94f7cea085778cac2a60c5f10cc /EdkModulePkg/Universal/PCD/Pei
parent3dd19b0d56310e40705bd6d38524ef488d94ed28 (diff)
downloadedk2-platforms-2b21a9713ce974c14f26dfb5d3496372e04b501b.tar.xz
Fixed a bug when input a invalid token number (not ZERO nor a valid token number) PcdLib should ASSERT.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@802 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Universal/PCD/Pei')
-rw-r--r--EdkModulePkg/Universal/PCD/Pei/Pcd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/EdkModulePkg/Universal/PCD/Pei/Pcd.c b/EdkModulePkg/Universal/PCD/Pei/Pcd.c
index 6d90671852..4ae4b27ef4 100644
--- a/EdkModulePkg/Universal/PCD/Pei/Pcd.c
+++ b/EdkModulePkg/Universal/PCD/Pei/Pcd.c
@@ -480,6 +480,9 @@ PeiPcdGetNextToken (
BOOLEAN Found;
if (Guid == NULL) {
+ if (*TokenNumber > PEI_NEX_TOKEN_NUMBER) {
+ return EFI_NOT_FOUND;
+ }
(*TokenNumber)++;
if (*TokenNumber > PEI_NEX_TOKEN_NUMBER) {
*TokenNumber = PCD_INVALID_TOKEN_NUMBER;