diff options
author | Sebastian Witt <sebastian.witt@siemens.com> | 2024-06-03 17:43:22 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-06-10 15:53:15 +0000 |
commit | 6d15276ceddd2bf05995ee2efa86316fca1cd73a (patch) | |
tree | aec91360b41032871d445aa7e7d8abefd596c9a1 | |
parent | 3dcc7b73df2b1c38c3c1a31724d577f4085f3ab1 (diff) | |
download | edk2-6d15276ceddd2bf05995ee2efa86316fca1cd73a.tar.gz |
UefiPayloadPkg: Fix LoadDxeCore for payload size > 16MB
Fix calculation of first section in FileFindSection for FILE2 headers
in UefiPayloadEntry module.
Signed-off-by: Sebastian Witt <sebastian.witt@siemens.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
-rw-r--r-- | UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c b/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c index 898d610951..3e13496147 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c +++ b/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c @@ -211,14 +211,15 @@ FileFindSection ( if (IS_FFS_FILE2 (FileHeader)) {
FileSize = FFS_FILE2_SIZE (FileHeader);
+ Section = (EFI_COMMON_SECTION_HEADER *)(((EFI_FFS_FILE_HEADER2 *)FileHeader) + 1);
} else {
FileSize = FFS_FILE_SIZE (FileHeader);
+ Section = (EFI_COMMON_SECTION_HEADER *)(FileHeader + 1);
}
FileSize -= sizeof (EFI_FFS_FILE_HEADER);
- Section = (EFI_COMMON_SECTION_HEADER *)(FileHeader + 1);
- Index = 0;
+ Index = 0;
while (Index < FileSize) {
if (Section->Type == SectionType) {
if (IS_SECTION2 (Section)) {
|