summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source
diff options
context:
space:
mode:
authorKonstantin Aladyshev <aladyshev22@gmail.com>2022-08-30 18:14:40 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-10-02 05:34:38 +0000
commit8be33c6544fae522e32c045ad81bac4d333dccb0 (patch)
tree563c71c117db145fc434a49b00d9ce8f2aaf00a6 /BaseTools/Source
parent9fc029ee6248e7998a478e02dc1abf82ac8ae376 (diff)
downloadedk2-8be33c6544fae522e32c045ad81bac4d333dccb0.tar.gz
edk2-8be33c6544fae522e32c045ad81bac4d333dccb0.tar.bz2
edk2-8be33c6544fae522e32c045ad81bac4d333dccb0.zip
BaseTools/VolInfo: Fix EFI_SECTION_GUID_DEFINED parsing
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>
Diffstat (limited to 'BaseTools/Source')
-rw-r--r--BaseTools/Source/C/VolInfo/VolInfo.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolInfo/VolInfo.c
index 184d753ba4..4628e756d7 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -2019,8 +2019,8 @@ Returns:
Status =
PutFileImage (
ToolInputFile,
- (CHAR8*) SectionBuffer + DataOffset,
- BufferLength - DataOffset
+ (CHAR8*)Ptr + DataOffset,
+ SectionLength - DataOffset
);
system (SystemCommand);
@@ -2065,8 +2065,8 @@ Returns:
//
printf ("/------------ Encapsulation section start -----------------\\\n");
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);