]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/VolInfo: Fix EFI_SECTION_GUID_DEFINED parsing
authorKonstantin Aladyshev <aladyshev22@gmail.com>
Tue, 30 Aug 2022 10:14:40 +0000 (18:14 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 2 Oct 2022 05:34:38 +0000 (05:34 +0000)
Currently 'PutFileImage' function is called with arguments that are
not advanced on each section parsing. This would lead to an error if
EFI_SECTION_GUID_DEFINED is not the first in a file.
The same mistake is present in the parsing of CRC32 guided section
case.
Use correct arguments to fix the issue.

Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
BaseTools/Source/C/VolInfo/VolInfo.c

index 184d753ba46e4fc460dfc318d9762773002a48e6..4628e756d76051b562dee86868d187f4dc6f08cf 100644 (file)
@@ -2019,8 +2019,8 @@ Returns:
         Status =\r
           PutFileImage (\r
             ToolInputFile,\r
-            (CHAR8*) SectionBuffer + DataOffset,\r
-            BufferLength - DataOffset\r
+            (CHAR8*)Ptr + DataOffset,\r
+            SectionLength - DataOffset\r
             );\r
 \r
         system (SystemCommand);\r
@@ -2065,8 +2065,8 @@ Returns:
         //\r
         printf ("/------------ Encapsulation section start -----------------\\\n");\r
         Status = ParseSection (\r
-                  SectionBuffer + DataOffset,\r
-                  BufferLength - DataOffset\r
+                  Ptr + DataOffset,\r
+                  SectionLength - DataOffset\r
                   );\r
         if (EFI_ERROR (Status)) {\r
           Error (NULL, 0, 0003, "parse of CRC32 GUIDED section failed", NULL);\r