summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Universal/PCD/Pei
diff options
context:
space:
mode:
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;