From nobody Mon Feb 9 15:10:21 2026 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+49798+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+49798+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1572588872; cv=none; d=zoho.com; s=zohoarc; b=Xhm/I0w4iaGmYS9es42JSxI9m1l5MLMft7i6HnfIQkys6biJtvVKYlFVmDh0EjZbgK6INmg4otVFdN66DM/pJsq2X9xdRNCdKcUKvEarPc6EZS3Bd5XhkTviumi+fG6SleenY2cM5NIYWDniF/RES6V5cKCJZW3BhviNJpXzTYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572588872; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=mneJyTLymy0TSXsD6nS7eJ8IHzDokHx7TMvvOeOUjuM=; b=gRNyaZeaPqwP45h3pasZH3tdsFFx8OOxE/4pqs/fsgm9ZYP2tdrbYCySslCuEZlX+f0gtMzJXDCIjWoxyD5SuCqHbCx7TqYUKWy7+7AwjM66Aai6tBzEqNxIHSX2l17OV9bC2/eSXAJoJFeBwKIHdAKgL6kiVn2KZohVJ2QHHH0= 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+49798+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 1572588872470526.4436855923047; Thu, 31 Oct 2019 23:14:32 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id R60OYY1788612xPctOw69xPo; Thu, 31 Oct 2019 23:14:32 -0700 X-Received: from mga17.intel.com (mga17.intel.com []) by mx.groups.io with SMTP id smtpd.web11.565.1572588865857342767 for ; Thu, 31 Oct 2019 23:14:31 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Oct 2019 23:14:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,254,1569308400"; d="scan'208";a="204426586" X-Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by orsmga006.jf.intel.com with ESMTP; 31 Oct 2019 23:14:30 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu Subject: [edk2-devel] [PATCH v3 4/4] MdeModulePkg/SetupBrowserDxe: ASSERT GetBufferForValue(&Value) Date: Fri, 1 Nov 2019 14:14:17 +0800 Message-Id: <20191101061417.28896-5-shenglei.zhang@intel.com> In-Reply-To: <20191101061417.28896-1-shenglei.zhang@intel.com> References: <20191101061417.28896-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: UPwPKAuH3SQ3lJGD0NqCa2NHx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1572588872; bh=yFRH+Zf39JvcyyH37y4iyzr+O/uPvMTAql3j7fTNpPE=; h=Cc:Date:From:Reply-To:Subject:To; b=eUKP6LQnQOQtlsdwBqZ5Veog8qoZ+IrxZeyeqpDC3E91RAq6W4Sf7L+i/x/AxCVlj52 7hCjG2AUgx3gW84739rVSKeSpZa+u7sFn5jrWo1JAxuuLJohQ4FpcCiPhUYSrkPzDURSb LF6LQHRKsmqPpiU0FtGnA8c/ztFDT2X86/o= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Before called by GetBufferForValue(), Value has already been called function IsTypeInBuffer to make sure the value must be buffer type. So GetBufferForValue can not return NULL. This commit adds ASSERT to assume (GetBufferForValue (&Value) is not NULL. Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang --- v3: Add ASSERT instead of using error handling. MdeModulePkg/Universal/SetupBrowserDxe/Expression.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModul= ePkg/Universal/SetupBrowserDxe/Expression.c index 7f4929c2fcd9..138912e00823 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c @@ -1281,7 +1281,10 @@ IfrToUint ( Result->Type =3D EFI_IFR_TYPE_UNDEFINED; return EFI_SUCCESS; } + + ASSERT ((GetBufferForValue (&Value) !=3D NULL); Result->Value.u64 =3D *(UINT64*) GetBufferForValue (&Value); + if (Value.Type =3D=3D EFI_IFR_TYPE_BUFFER) { FreePool (Value.Buffer); } --=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 (#49798): https://edk2.groups.io/g/devel/message/49798 Mute This Topic: https://groups.io/mt/40403790/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-