]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Library/PeiRsa2048Sha256GuidedSectionExtractLib/PeiRsa2048Sha256GuidedSectionExtractLib.c
SecurityPkg : Fix Rsa2048Sha256GuidedSectionExtractLib issue
[mirror_edk2.git] / SecurityPkg / Library / PeiRsa2048Sha256GuidedSectionExtractLib / PeiRsa2048Sha256GuidedSectionExtractLib.c
index e2a0fb6708845eda93736172f2d24ee7f8aee171..e448164a5a33fea6275b8fd1e4e5afe0bd3787bd 100644 (file)
@@ -84,7 +84,7 @@ Rsa2048Sha256GuidedSectionGetInfo (
     //\r
     *SectionAttribute  = ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes;\r
     *ScratchBufferSize = 0;\r
-    *OutputBufferSize  = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;\r
+    *OutputBufferSize  = SECTION2_SIZE (InputSection) - sizeof(RSA_2048_SHA_256_SECTION2_HEADER);\r
   } else {\r
     //\r
     // Check whether the input guid section is recognized.\r
@@ -99,7 +99,7 @@ Rsa2048Sha256GuidedSectionGetInfo (
     //\r
     *SectionAttribute  = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;\r
     *ScratchBufferSize = 0;\r
-    *OutputBufferSize  = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;\r
+    *OutputBufferSize  = SECTION_SIZE (InputSection) - sizeof(RSA_2048_SHA_256_SECTION_HEADER);\r
   }\r
 \r
   return EFI_SUCCESS;\r