From nobody Tue May 7 13:26:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+49143+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+49143+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1571282379; cv=none; d=zoho.com; s=zohoarc; b=VJ6UJCW98VDm4Fp7tXgjcTbDGDIbecmssAtZxRGqZSEe3yybeTjQhx2poCcxo7tuNIRyxAuVN7ZCa8lyk/mBVz7QhLmkZzVTYcIiBwtLwXM31VNyayeGlFS3vAkE2Qi+5/kGfukhPFGSn6xOyL76CZtJ6XVfujG2EK/u6izrAQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571282379; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=lovshwENsxTDx8g65ZE1f2GYmuIbFNF7uxkTVQNQccc=; b=UBnPBbfwpAkLqiFbVPT1hj3/M5Oyu4QkU+1CSrgAZrKyZY0uiVPQ82dAWyeMae30m5800tqYb717EbJW3XDOJEmmk+sHRO5AWszo8pwGC35PfrGScHdsuipQMw2ooYi7kvEeyQ0Gb3QBcYRpDydvIYJihDU5dUGKN9jTrQncFQ4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+49143+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 157128237992540.983555943445936; Wed, 16 Oct 2019 20:19:39 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id TRhAYY1788612xUAq9VXn2rK; Wed, 16 Oct 2019 20:19:39 -0700 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.1892.1571282378907852418 for ; Wed, 16 Oct 2019 20:19:39 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2019 20:19:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,306,1566889200"; d="scan'208";a="208127699" X-Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by orsmga002.jf.intel.com with ESMTP; 16 Oct 2019 20:19:37 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Hao A Wu , Liming Gao Subject: [edk2-devel] [PATCH] MdeModulePkg/Variable/Pei: Update the condition in if statement Date: Thu, 17 Oct 2019 11:19:35 +0800 Message-Id: <20191017031935.19796-1-shenglei.zhang@intel.com> Precedence: Bulk List-Unsubscribe: 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,shenglei.zhang@intel.com X-Gm-Message-State: 6VsprI7o0iPizR2zbuLTSr4dx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1571282379; bh=6U+J0v7iivzVCACN9tuVmCsr95YJyOdKNrgF+DkIBm8=; h=Cc:Date:From:Reply-To:Subject:To; b=hZOMwYDhe+L6y3IcC66n0wFuLYpHbIedNCVRTN9eOHoUc5d1LujiJv5pSQJS4wYcFSW GPDiXneqy0vvp10Og1RnM1Oi/LpYxgVJ3b3u2FT0wd6POeFB1rGg9SKbaX1UioM8fCDLX RMt8iDAxnwH9dfSP4E/yHGz9+vTS79Xl8LQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" IndexTable->Length is used as index in array IndexTable->Index[]. So IndexTable->Length needs to be checked, which should be less than the array size. Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Shenglei Zhang Reviewed-by: Hao A Wu --- MdeModulePkg/Universal/Variable/Pei/Variable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.c b/MdeModulePkg/= Universal/Variable/Pei/Variable.c index 715802f33c29..f61465fc3045 100644 --- a/MdeModulePkg/Universal/Variable/Pei/Variable.c +++ b/MdeModulePkg/Universal/Variable/Pei/Variable.c @@ -896,7 +896,7 @@ FindVariableEx ( // if ((IndexTable !=3D NULL) && !StopRecord) { Offset =3D (UINTN) Variable - (UINTN) LastVariable; - if ((Offset > 0x0FFFF) || (IndexTable->Length =3D=3D sizeof (Index= Table->Index) / sizeof (IndexTable->Index[0]))) { + if ((Offset > 0x0FFFF) || (IndexTable->Length >=3D sizeof (IndexTa= ble->Index) / sizeof (IndexTable->Index[0]))) { // // Stop to record if the distance of two neighbouring VAR_ADDED = variable is larger than the allowable scope(UINT16), // or the record buffer is full. --=20 2.18.0.windows.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 (#49143): https://edk2.groups.io/g/devel/message/49143 Mute This Topic: https://groups.io/mt/34668808/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-