FMMT will crash if there is no fv ext_header in a specific FV. This patch is going to add a check point for this case.
Signed-off-by: Bob Feng <bob.c.f...@intel.com> Cc: Liming Gao <gaolim...@byosoft.com.cn> Cc: Yuwei Chen <yuwei.c...@intel.com> --- BaseTools/Source/C/FMMT/FmmtLib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BaseTools/Source/C/FMMT/FmmtLib.c b/BaseTools/Source/C/FMMT/FmmtLib.c index fa77ed7317..4f6056edba 100644 --- a/BaseTools/Source/C/FMMT/FmmtLib.c +++ b/BaseTools/Source/C/FMMT/FmmtLib.c @@ -4544,16 +4544,18 @@ LibEncapNewFvFile( if (CurrentEncapData != NULL) { LocalEncapData = CurrentEncapData; while (LocalEncapData->Level != ParentLevel) { LocalEncapData = LocalEncapData->NextNode; } + if (LocalEncapData->FvExtHeader !=NULL) { for (Index = 0; Index <= FvInFd->FfsNumbers; Index++) { if ((memcmp(&FvInFd->FfsAttuibutes[Index].GuidName, &(LocalEncapData->FvExtHeader->FvName), sizeof(EFI_GUID)) == 0)) { SubFvId = Index; break; } } + } } // // Found FFSs from Fv structure. // FfsFoundFlag = FALSE; -- 2.29.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75553): https://edk2.groups.io/g/devel/message/75553 Mute This Topic: https://groups.io/mt/83070312/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-