From nobody Thu Mar 28 10:14:22 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+49795+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+49795+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1572588868; cv=none; d=zoho.com; s=zohoarc; b=O82rYY/+pfz2OStYH1CbNLNRoqVsGO5DjrcCUoJSAkWzcrAUZ0/aFxd6Cftcx1C67vlwNCQomT0+/Kp5Vf9Gg822rzl+uM6bZMhoxlGbL9d/6kgyUEHKRSvS080H5r/9l5vCATJP+mMEiPyVlCZB8V2cOWhcToNwGmWlB2y75m0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572588868; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=J7XfCYpzyRkHZPo1Yhmvsx5sWtTRw+cfdpj/rmXvc4o=; b=KLVuNCeF4rHtAd391RPpRH4avO/zkunyWBhuFupxel9bbPshJkYRv7l0L6C9ahI013Doii1nQpcKWNNSJGCzKlkUw8S5arwcu+bA1bpC0OW68akd0hp+S1SWg045eH1pdSZG84bgMxdtlgAG6ZIlrmVUQFVpm326HQatfSrsBrI= 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+49795+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 157258886837396.004863969457; Thu, 31 Oct 2019 23:14:28 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Ol7CYY1788612xNZszVhQyG6; Thu, 31 Oct 2019 23:14:27 -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:27 -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:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,254,1569308400"; d="scan'208";a="204426462" 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:25 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu Subject: [edk2-devel] [PATCH v3 1/4] MdeModulePkg/EbcDebugger: Add check for Entry and RetEntry Date: Fri, 1 Nov 2019 14:14:14 +0800 Message-Id: <20191101061417.28896-2-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: N6BGjouwUbvwpElernjkEj0ax1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1572588867; bh=Jao0wWQ+uRp4li95AvvNY1tZ7Lz2cMowzQnWFpSbNuc=; h=Cc:Date:From:Reply-To:Subject:To; b=XgthwTAWdg39iaX/AOpn/hdpD2bxmXc0TTSrWnUqLA5UXEfz6IpedIHaeoYwuLoCcuF wFKJu0FW+Z2j6rvs2tRD8j0V4vWTozSg58VMTqUhMtbxncGluoOpLiMxSPrXuNDj3Te9K jIVDBTdx5tFDfJAwVk8luOkV2nM3m4jBCbE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Entry and RetEntry might be NULL before used. Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang Reviewed-by: Hao A Wu --- MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c | 2 +- MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c b/Mde= ModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c index 8e305e4243a5..7b453fa98c2b 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c @@ -143,7 +143,7 @@ DebuggerDisplaySymbolAccrodingToAddress ( // Find the nearest symbol address // CandidateAddress =3D EbdFindSymbolAddress (Address, EdbMatchSymbolTypeNe= arestAddress, &Object, &Entry); - if (CandidateAddress =3D=3D 0 || CandidateAddress =3D=3D (UINTN) -1) { + if (CandidateAddress =3D=3D 0 || CandidateAddress =3D=3D (UINTN) -1 || E= ntry =3D=3D NULL) { EDBPrint (L"Symbole at Address not found!\n"); return EFI_DEBUG_CONTINUE; } else if (Address !=3D CandidateAddress) { diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c b/MdeMod= ulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c index 85cc275c114b..90a9b9fbd7ee 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c @@ -2062,7 +2062,7 @@ EdbPrintSource ( &RetObject, &RetEntry ); - if (SymbolAddress =3D=3D 0) { + if (SymbolAddress =3D=3D 0 || RetEntry =3D=3D NULL) { return 0 ; } =20 --=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 (#49795): https://edk2.groups.io/g/devel/message/49795 Mute This Topic: https://groups.io/mt/40403787/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- From nobody Thu Mar 28 10:14:22 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+49796+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+49796+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1572588869; cv=none; d=zoho.com; s=zohoarc; b=fpJgrb9LtmfgP9rwWc7Jr8siHCxMBWvyyF4rGwpF9bpk8JEqFD7/TMRLmPjcs+6h1DA8PBq+j2uSjGsDMXj65EISwJsrSovC9QM/yxP4NvaU4ruNWIYwb9ZZQoCjhqPrjSpBBzyBnzgnJULk5zbl4xUcDRoALX/QHMNn76jRhnU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572588869; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=iP8G13b28E2oEroX/Y+Bnws0xcb3E733v8u+Y4Mvt1c=; b=gi2fGaNOvOrEWX0ivEG3M48VpVk6hGpW1GFMGVl100JCgjX+QCZ9dnVgmQQKFU08DXb0AXmrkvbFX1C9zdfx/D7QoSFJ7Ix2HmL0M5yeWCcHd1YBBXJ1J9oonIduRDaPhjvwzieDnna42qWcRggIXZDpYD8AwWJshHJKbdHS/BE= 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+49796+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 1572588869342201.11797565908978; Thu, 31 Oct 2019 23:14:29 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id KXMEYY1788612xB3R4Z3vN9s; Thu, 31 Oct 2019 23:14:28 -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:28 -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:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,254,1569308400"; d="scan'208";a="204426480" 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:27 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Dandan Bi , Eric Dong Subject: [edk2-devel] [PATCH v3 2/4] MdeModulePkg/HiiDatabaseDxe: ASSERT StringPtr Date: Fri, 1 Nov 2019 14:14:15 +0800 Message-Id: <20191101061417.28896-3-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: f8fP3PLftmjk0xTqykprmynGx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1572588868; bh=tnaLCUidL/llwyNdw47ls1fP1ZD+M+GxnSgEKJGMjJE=; h=Cc:Date:From:Reply-To:Subject:To; b=cfQgzFHVCQ3/GyB6CFZUMll1Ww281PmAAyFWEJxwRy5rPXx33vubUf80ZbjDYoOdvQY UbNjJ1LFPwRMKnfgFE/2csP03gccZZGm2CAaIY9ovo0iDmaF9Sj9HOz+jE7RV5/O3Pddd By+OiSgNnS1Ww7c0gopM1/xFGXGmcl9TKBs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The caller of CompareAndMergeDefaultString has checked that AltCfgResp must contain AltConfigHdr. So we add ASSERT to assume StringPtr is not NULL. Cc: Dandan Bi Cc: Eric Dong Signed-off-by: Shenglei Zhang Reviewed-by: Dandan Bi --- MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeMod= ulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 71ea25bc19bf..2cad6d29f455 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -909,6 +909,7 @@ CompareAndMergeDefaultString ( // To find the with AltConfigHdr in AltCfgResp, ignore other <= AltResp> which follow it. // StringPtr =3D StrStr (*AltCfgResp, AltConfigHdr); + ASSERT (StringPtr !=3D NULL); StringPtrNext =3D StrStr (StringPtr + 1, L"&GUID"); if (StringPtrNext !=3D NULL) { TempCharA =3D *StringPtrNext; --=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 (#49796): https://edk2.groups.io/g/devel/message/49796 Mute This Topic: https://groups.io/mt/40403788/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- From nobody Thu Mar 28 10:14:22 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+49797+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+49797+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1572588871; cv=none; d=zoho.com; s=zohoarc; b=Wm0Yx8JuRGaJ82Faz64Aw5o/NpbYTWJ6qRO0b/nU+7RuhgO7IaQQ0zXDKB8wc9DgrA56VJTfN5T8N4fURJf5X/3bPsSM//P6tWjh2g7um2xLA3+SSTOO13g499C1lKIQjXk8LYCl116+MqF23TlB9Kxw+lw01xZ8OqFlZRHCxzE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572588871; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=go3/AeDgV+2JE+MwI9iftC27t1XRVMC596kdpRzgyls=; b=BVYRkVuSAvYwwo6IMKFtZIMa2rl9pjgUJy8eonYeyWXusMaRc+2wwLI47NWPxzbe+9SpYM4CytB8KMVHD1dgzejuDuiR0wMWops7MjK9Ph0/sUvj/YC+ZQD6kuow6JtaZ2SZaw1PSVatXHSbgRsk0MJrUFf8VZK6bansJv32SA8= 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+49797+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 1572588871172638.5108326021757; Thu, 31 Oct 2019 23:14:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id SqbSYY1788612xyzSV0wT4Tq; Thu, 31 Oct 2019 23:14:30 -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:30 -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:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,254,1569308400"; d="scan'208";a="204426558" 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:28 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Hao A Wu , Liming Gao Subject: [edk2-devel] [PATCH v3 3/4] MdeModulePkg/EsrtDxe: Add check for EsrtRepository Date: Fri, 1 Nov 2019 14:14:16 +0800 Message-Id: <20191101061417.28896-4-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: UgvTNk1sVJeyq6xUgTZ3O99lx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1572588870; bh=f/T3i591hOb38fT4TGPeYYQaHyH+xL3GOxqUZjaPwkQ=; h=Cc:Date:From:Reply-To:Subject:To; b=wlNL5L3WJgCSAaygm2EWGRKc/3BYng6xdXTEdEm9qCbTTbqdBiaVQ4gjRsHEtJcj41B 5awrIqnvSkfsUDoGPzAMxYxzNzcojJPc25PhE6/en+zTmncMwkCStaeLMc8RYF1jCkH92 WomzhYMjzWyfIUFJWgwUSzKeYAiAy2/6AR4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" EsrtRepository might be NULL. So return EFI_OUT_OF_RESOURCES when it is NULL. Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Shenglei Zhang Reviewed-by: Hao A Wu --- MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c b/MdeModulePkg/Unive= rsal/EsrtDxe/EsrtImpl.c index f48125382dbc..fff17b98fa3d 100644 --- a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c +++ b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c @@ -239,6 +239,11 @@ DeleteEsrtEntry( goto EXIT; } =20 + if (EsrtRepository =3D=3D NULL) { + Status =3D EFI_OUT_OF_RESOURCES; + goto EXIT; + } + if ((RepositorySize % sizeof(EFI_SYSTEM_RESOURCE_ENTRY)) !=3D 0) { DEBUG((EFI_D_ERROR, "Repository Corrupt. Need to rebuild Repository.\n= ")); // @@ -332,6 +337,11 @@ UpdateEsrtEntry( &RepositorySize ); =20 + if (EsrtRepository =3D=3D NULL) { + Status =3D EFI_OUT_OF_RESOURCES; + goto EXIT; + } + if (!EFI_ERROR(Status)) { // // if exist, update Esrt cache repository --=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 (#49797): https://edk2.groups.io/g/devel/message/49797 Mute This Topic: https://groups.io/mt/40403789/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- From nobody Thu Mar 28 10:14:22 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+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-