summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--StandaloneMmPkg/Include/Library/FvLib.h2
-rw-r--r--StandaloneMmPkg/Library/FvLib/FvLib.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/StandaloneMmPkg/Include/Library/FvLib.h b/StandaloneMmPkg/Include/Library/FvLib.h
index 1eb9ea7..3b603e4 100644
--- a/StandaloneMmPkg/Include/Library/FvLib.h
+++ b/StandaloneMmPkg/Include/Library/FvLib.h
@@ -87,7 +87,7 @@ FindFfsSectionInSections (
@param FfsFileHeader Pointer to the current file to search.
@param SectionData Pointer to the Section matching SectionType in FfsFileHeader.
NULL if section not found
- @param SectionDataSize The size of SectionData
+ @param SectionDataSize The size of SectionData, excluding the section header.
@retval EFI_NOT_FOUND No files matching the search criteria were found
@retval EFI_SUCCESS
diff --git a/StandaloneMmPkg/Library/FvLib/FvLib.c b/StandaloneMmPkg/Library/FvLib/FvLib.c
index 89504b9..e0f344a 100644
--- a/StandaloneMmPkg/Library/FvLib/FvLib.c
+++ b/StandaloneMmPkg/Library/FvLib/FvLib.c
@@ -338,11 +338,11 @@ FfsFindSection (
Given the input file pointer, search for the next matching section in the
FFS volume.
- @param SearchType Filter to find only sections of this type.
- @param FfsFileHeader Pointer to the current file to search.
- @param SectionData Pointer to the Section matching SectionType in FfsFileHeader.
- NULL if section not found
- @param SectionDataSize The size of SectionData
+ @param[in] SectionType Filter to find only sections of this type.
+ @param[in] FfsFileHeader Pointer to the current file to search.
+ @param[in,out] SectionData Pointer to the Section matching SectionType in FfsFileHeader.
+ NULL if section not found
+ @param[in,out] SectionDataSize The size of SectionData, excluding the section header.
@retval EFI_NOT_FOUND No files matching the search criteria were found
@retval EFI_SUCCESS
@@ -380,10 +380,10 @@ FfsFindSectionData (
if (Section->Type == SectionType) {
if (IS_SECTION2 (Section)) {
*SectionData = (VOID *)((EFI_COMMON_SECTION_HEADER2 *)Section + 1);
- *SectionDataSize = SECTION2_SIZE (Section);
+ *SectionDataSize = SECTION2_SIZE (Section) - sizeof (EFI_COMMON_SECTION_HEADER2);
} else {
*SectionData = (VOID *)(Section + 1);
- *SectionDataSize = SECTION_SIZE (Section);
+ *SectionDataSize = SECTION_SIZE (Section) - sizeof (EFI_COMMON_SECTION_HEADER);
}
return EFI_SUCCESS;