Skip to content

Commit 1c74842

Browse files
GowthamM9974mergify[bot]
authored andcommitted
ArmPkg/Library: fix: Incorrect SectionLength Calculation.
Ref:[059332b] Rootcause: The SectionLength was incorrectly computed using the FFS_FILE_SIZE() macro. This macro operates on the EFI_FFS_FILE_HEADER structure, which is incompatible with the SECTION_SIZE header format. This mismatch introduces a potential defect due to inaccurate section size calculation. Solution: To ensure correctness and structural alignment, SectionLength must be computed using the SECTION_SIZE macro defined in MdePkg\Include\Pi\PiFirmwareFile.h. This macro performs size extraction using byte-wise access. Cc: Sachin Ganesh <[email protected]> Signed-off-by: Gowtham M <[email protected]>
1 parent 49d4753 commit 1c74842

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ GetImageContext (
196196
// SectionLength is adjusted it is 4 byte aligned.
197197
// Go to the next section
198198
//
199-
SectionLength = FFS_FILE_SIZE (FfsHeader);
199+
SectionLength = SECTION_SIZE (Section);
200200
SectionLength = GET_OCCUPIED_SIZE (SectionLength, 4);
201201
ASSERT (SectionLength != 0);
202202
ParsedLength += SectionLength;

0 commit comments

Comments
 (0)