X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FCore%2FDxeIplPeim%2FDxeLoad.c;h=901b061973965052b64f332de182b40dadeb16a1;hp=e7359e5684824bc7e04ee754792cbbd6df428011;hb=1b0d0cc5f108d65135c26259ff81c60dd2cc6d74;hpb=d8c79a815f9e993b741ec38cd39498e674e1739e diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c index e7359e5684..901b061973 100644 --- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c +++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c @@ -647,7 +647,7 @@ Returns: EFI_STATUS Status; UINT8 *DstBuffer; UINT8 *ScratchBuffer; - UINT32 DstBufferSize; + UINTN DstBufferSize; UINT32 ScratchBufferSize; EFI_COMMON_SECTION_HEADER *CmpSection; UINTN CmpSectionLength; @@ -736,6 +736,7 @@ Returns: DEBUG ((EFI_D_ERROR, "Extract section content failed - %r\n", Status)); return Status; } + // // Todo check AuthenticationStatus and do the verify // @@ -754,7 +755,7 @@ Returns: Status = UefiDecompressGetInfo ( (UINT8 *) ((EFI_COMPRESSION_SECTION *) Section + 1), (UINT32) SectionLength - sizeof (EFI_COMPRESSION_SECTION), - &DstBufferSize, + (UINT32 *) &DstBufferSize, &ScratchBufferSize ); if (EFI_ERROR (Status)) { @@ -958,7 +959,8 @@ CustomDecompressExtractSection ( EFI_STATUS Status; UINT8 *ScratchBuffer; UINT32 ScratchSize; - UINT32 SectionLength; + UINT32 SectionLength; + UINT32 DestinationSize; // // Set authentic value to zero. @@ -975,7 +977,7 @@ CustomDecompressExtractSection ( (GUID *) ((UINT8 *) InputSection + sizeof (EFI_COMMON_SECTION_HEADER)), (UINT8 *) InputSection + sizeof (EFI_GUID_DEFINED_SECTION), SectionLength - sizeof (EFI_GUID_DEFINED_SECTION), - OutputSize, + &DestinationSize, &ScratchSize ); if (EFI_ERROR (Status)) { @@ -996,6 +998,7 @@ CustomDecompressExtractSection ( // // Allocate destination buffer // + *OutputSize = (UINTN) DestinationSize; *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (*OutputSize)); if (*OutputBuffer == NULL) { return EFI_OUT_OF_RESOURCES;