public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2] BaseTools/VolInfo: Fix EFI_SECTION_GUID_DEFINED parsing
@ 2022-07-19 13:27 Konstantin Aladyshev
  0 siblings, 0 replies; only message in thread
From: Konstantin Aladyshev @ 2022-07-19 13:27 UTC (permalink / raw)
  To: devel; +Cc: bob.c.feng, gaoliming, yuwei.chen, Konstantin Aladyshev

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>
---
 BaseTools/Source/C/VolInfo/VolInfo.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolInfo/VolInfo.c
index ed56587058..b550815765 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -2000,8 +2000,8 @@ Returns:
         Status =
           PutFileImage (
             ToolInputFile,
-            (CHAR8*) SectionBuffer + DataOffset,
-            BufferLength - DataOffset
+            (CHAR8*)Ptr + DataOffset,
+            SectionLength - DataOffset
             );
 
         system (SystemCommand);
@@ -2043,8 +2043,8 @@ Returns:
         // CRC32 guided section
         //
         Status = ParseSection (
-                  SectionBuffer + DataOffset,
-                  BufferLength - DataOffset
+                  Ptr + DataOffset,
+                  SectionLength - DataOffset
                   );
         if (EFI_ERROR (Status)) {
           Error (NULL, 0, 0003, "parse of CRC32 GUIDED section failed", NULL);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-19 13:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-19 13:27 [PATCH v2] BaseTools/VolInfo: Fix EFI_SECTION_GUID_DEFINED parsing Konstantin Aladyshev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox