X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FCore%2FPei%2FDispatcher%2FDispatcher.c;fp=MdeModulePkg%2FCore%2FPei%2FDispatcher%2FDispatcher.c;h=0ac3fdde6a9a7440b6ccc570028ba23a0f2b078e;hp=027176d872c76e3a4c3b404b0ad9c992869d6f2e;hb=b22d093101b0dee64f289407629bb872933aa2f2;hpb=b6d5def2faf56334128ea2f056356d7e3852831e diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index 027176d872..0ac3fdde6a 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -976,7 +976,7 @@ PeiDispatcher ( SaveCurrentFvCount = Private->CurrentPeimFvCount; SaveCurrentFileHandle = Private->CurrentFileHandle; - for (Index1 = 0; Index1 <= SaveCurrentFvCount; Index1++) { + for (Index1 = 0; Index1 < Private->FvCount; Index1++) { for (Index2 = 0; (Index2 < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) { if (Private->Fv[Index1].PeimState[Index2] == PEIM_STATE_REGISTER_FOR_SHADOW) { PeimFileHandle = Private->Fv[Index1].FvFileHandles[Index2];