edk2/BaseTools/Source/Python/FMMT/core
Evgenii Shatokhin e93ee87643 BaseTools: FMMT: Fix incorrect size calculation in ModifyTest()
There is another issue in FvHander.py similar to the one fixed by
a60334ad59 ("BaseTools: Fix FMMT FvHandler Padding operation issue").

For a guided section (ParTree.Data.Type == 0x02), the length of
ParTree.Data.OriData is used to obtain the original size of the data even
after ParTree.Data.OriData has changed, which is incorrect.

This caused the following issue I observed. I built OVMF image for Aarch64
and then tried to add a couple FFS modules to it with 'FMMT -a [...]'. The
resulting image turned out to be invalid: the total size of the image was
less than the size of the firmware volume within it.

UEFITool failed to load such firmware image and complained:
"parseRawArea: one of objects inside overlaps the end of data".

This patch fixes the issue.

Signed-off-by: Evgenii Shatokhin <euspectre@gmail.com>
2025-11-22 11:53:36 +00:00
..
BinaryFactoryProduct.py BaseTools/FMMT: Fix errors when operating the FV with CRC32 section 2025-10-16 14:14:06 +00:00
BiosTree.py BaseTools: FMTT: Remove unnecessary code 2025-07-01 09:51:38 +08:00
BiosTreeNode.py BaseTools: FMTT: Remove unnecessary code 2025-07-01 09:51:38 +08:00
FMMTOperation.py BaseTools: Fix NoneType parent reference in FMMT operations 2025-01-27 16:26:18 +00:00
FMMTParser.py BaseTools: FMMT support ELF UPLD parser 2023-12-11 10:12:52 +00:00
FvHandler.py BaseTools: FMMT: Fix incorrect size calculation in ModifyTest() 2025-11-22 11:53:36 +00:00
GuidTools.py BaseTools/FMMT: Fix GUID Tool Not Found the Shell Script Issue 2025-03-26 05:37:32 +00:00