From 2b21a9713ce974c14f26dfb5d3496372e04b501b Mon Sep 17 00:00:00 2001 From: qwang12 Date: Thu, 6 Jul 2006 13:34:25 +0000 Subject: 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 --- EdkModulePkg/Universal/PCD/Pei/Pcd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'EdkModulePkg/Universal/PCD/Pei') 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; -- cgit v1.2.3