From nobody Mon Apr 29 01:26:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+91529+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91529+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1658237239; cv=none; d=zohomail.com; s=zohoarc; b=nEiL6GdCrUrADNCAaij60jSD/hJRhBJOVOsr2IXNxfEX3BERkCOBU28yRnQeeHr9KVSDlJGf1f/19106UzfDxMAS2wSvgcLxY+E2Ohx0ql/XTiPHwMDzuvFM8uwr0F1QBTLggiJfng83Ztj13XL7IuBbWx8evG38ePildZRYfMs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658237239; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=YtUjBe87qH/8wx2n8Eoxf2C3hqcEdR21kIEPakDEL50=; b=En5FxNzaM3wSsWqO+JPerLewfhIaTQhbO81DUm3uRNXvPN70H7gVqzI+8j8HUjYKYM1eahwE3uHarYF2YmYk2y6Bd8ho+7AsbWjFDgPKu7tCLJYyMHpTL/f6IQX/DOKFnckXz07kIouPQ8mtaniylwGXwhRxHn8F66+0j0TdCo4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91529+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1658237239819520.2605364673542; Tue, 19 Jul 2022 06:27:19 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id JFTvYY1788612xNsN2O6JRBn; Tue, 19 Jul 2022 06:27:18 -0700 X-Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by mx.groups.io with SMTP id smtpd.web12.40587.1658237237575132682 for ; Tue, 19 Jul 2022 06:27:17 -0700 X-Received: by mail-lj1-f181.google.com with SMTP id o12so17370308ljc.3 for ; Tue, 19 Jul 2022 06:27:17 -0700 (PDT) X-Gm-Message-State: WInSJiDWDfISQkecPuU1Q0nNx1787277AA= X-Google-Smtp-Source: AGRyM1vljm6hqSYp3Tu6ZeZnCph84LxS5oiVIgUWMxUa6dTdaiLpukqIozbs7BfNFM2wUFTtQllnNA== X-Received: by 2002:a2e:bd0a:0:b0:25d:d2a3:7366 with SMTP id n10-20020a2ebd0a000000b0025dd2a37366mr362183ljq.35.1658237235494; Tue, 19 Jul 2022 06:27:15 -0700 (PDT) X-Received: from PC10319.67 ([82.97.198.254]) by smtp.googlemail.com with ESMTPSA id b17-20020a2eb911000000b0025d61016a70sm2666312ljb.28.2022.07.19.06.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 06:27:15 -0700 (PDT) From: "Konstantin Aladyshev" To: devel@edk2.groups.io Cc: bob.c.feng@intel.com, gaoliming@byosoft.com.cn, yuwei.chen@intel.com, Konstantin Aladyshev Subject: [edk2-devel] [PATCH v2] BaseTools/VolInfo: Fix EFI_SECTION_GUID_DEFINED parsing Date: Tue, 19 Jul 2022 16:27:15 +0300 Message-Id: <20220719132715.6877-1-aladyshev22@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,aladyshev22@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1658237238; bh=nLiv7enPYvKGfAmnu4t3SbgOl5wLhC0z+2ip6/ZuA20=; h=Cc:Date:From:Reply-To:Subject:To; b=oMLoGZxPQrxtAKl36QTw4ldFuyRq6+J+5Zv8CEU+qKIkD31Lw0u6eCR4mZnEBRSUcUw xqlus50YlE8M3biM4DbrC259AkTrrmw0/fvTWJmWOBv+v08ClirkNK9Dv3EK83n1yCMkk ulU4s0ibwr6Nnj1nQVjV0/Lw7paDmVQrFCY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1658237241413100003 Content-Type: text/plain; charset="utf-8" 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 --- 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/VolI= nfo/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 =3D PutFileImage ( ToolInputFile, - (CHAR8*) SectionBuffer + DataOffset, - BufferLength - DataOffset + (CHAR8*)Ptr + DataOffset, + SectionLength - DataOffset ); =20 system (SystemCommand); @@ -2043,8 +2043,8 @@ Returns: // CRC32 guided section // Status =3D ParseSection ( - SectionBuffer + DataOffset, - BufferLength - DataOffset + Ptr + DataOffset, + SectionLength - DataOffset ); if (EFI_ERROR (Status)) { Error (NULL, 0, 0003, "parse of CRC32 GUIDED section failed", NU= LL); --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91529): https://edk2.groups.io/g/devel/message/91529 Mute This Topic: https://groups.io/mt/92482218/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-