From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web12.1275.1572574029464171265 for ; Thu, 31 Oct 2019 19:07:09 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: dandan.bi@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Oct 2019 19:07:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,253,1569308400"; d="scan'208";a="190831622" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga007.jf.intel.com with ESMTP; 31 Oct 2019 19:07:08 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 31 Oct 2019 19:07:07 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.127]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.60]) with mapi id 14.03.0439.000; Fri, 1 Nov 2019 10:07:03 +0800 From: "Dandan Bi" To: "Zhang, Shenglei" , "devel@edk2.groups.io" CC: "Dong, Eric" Subject: Re: [PATCH v2 2/4] MdeModulePkg/HiiDatabaseDxe: Add check for StringPtr Thread-Topic: [PATCH v2 2/4] MdeModulePkg/HiiDatabaseDxe: Add check for StringPtr Thread-Index: AQHVjy4nTVFZX5bl30WAxu5cba0Bf6d1knmg Date: Fri, 1 Nov 2019 02:07:02 +0000 Message-ID: <3C0D5C461C9E904E8F62152F6274C0BB40C94315@SHSMSX104.ccr.corp.intel.com> References: <20191030142710.42756-1-shenglei.zhang@intel.com> <20191030142710.42756-3-shenglei.zhang@intel.com> In-Reply-To: <20191030142710.42756-3-shenglei.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: dandan.bi@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Shenglei, Please update the commit message and subject before commit, since we have a= dded ASSERT code for this case that the StringPtr cannot be NULL instead of= adding check. With the commit message updated, Reviewed-by: Dandan Bi . Thanks, Dandan > -----Original Message----- > From: Zhang, Shenglei > Sent: Wednesday, October 30, 2019 10:27 PM > To: devel@edk2.groups.io > Cc: Bi, Dandan ; Dong, Eric > Subject: [PATCH v2 2/4] MdeModulePkg/HiiDatabaseDxe: Add check for > StringPtr >=20 > If the target string doesn't appear in the searched string, StringPtr wil= l be > NULL. So add a check for that. >=20 > Cc: Dandan Bi > Cc: Eric Dong > Signed-off-by: Shenglei Zhang > --- > v2: Instead of returning a value, we add ASSERT to ensure > StringPtr is not NULL. >=20 > MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c > b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c > index 71ea25bc19bf..19a23fcc951e 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 > 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; > -- > 2.18.0.windows.1