From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.8438.1583385133195265261 for ; Wed, 04 Mar 2020 21:12:13 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: shenglei.zhang@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Mar 2020 21:12:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,516,1574150400"; d="scan'208";a="413400277" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 04 Mar 2020 21:12:10 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Mar 2020 21:12:10 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Mar 2020 21:12:09 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.206]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.155]) with mapi id 14.03.0439.000; Thu, 5 Mar 2020 13:12:07 +0800 From: "Zhang, Shenglei" To: "devel@edk2.groups.io" , "newexplorerj@gmail.com" CC: "Kinney, Michael D" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH v2] MdePkg/UnitTestBaseLib: Pointer BinData need to be checked Thread-Topic: [edk2-devel] [PATCH v2] MdePkg/UnitTestBaseLib: Pointer BinData need to be checked Thread-Index: AQHV8qBdXrWR+Jxp/k2Rk8T1kSnSkqg5cnyg Date: Thu, 5 Mar 2020 05:12:07 +0000 Message-ID: References: <8826d6055406855f0fff1ab10515f6182ae10616.1583379517.git.newexplorerj@gmail.com> In-Reply-To: <8826d6055406855f0fff1ab10515f6182ae10616.1583379517.git.newexplorerj@gmail.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: shenglei.zhang@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Please update the subject " MdePkg/UnitTestBaseLib: Add check for pointer B= inData" With this updated, Reviewed-by: Shenglei Zhang We should try to describe the changes in subject rather than a problem it = fixes. It can be described in the body of commit message.=20 Thanks, Shenglei > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > GuoMinJ > Sent: Thursday, March 5, 2020 11:40 AM > To: devel@edk2.groups.io > Cc: GuoMinJ ; Kinney, Michael D > ; Gao, Liming > Subject: [edk2-devel] [PATCH v2] MdePkg/UnitTestBaseLib: Pointer BinData > need to be checked >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2531 >=20 > AllocatePool may fail and BinData may be invalid, check > it before use. >=20 > Cc: Michael D Kinney > Cc: Liming Gao > Signed-off-by: GuoMinJ > --- > MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c > b/MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c > index 6f7c31cab4..933d2b40e0 100644 > --- a/MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c > +++ b/MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c > @@ -252,6 +252,9 @@ RfcDecodeTest( > BinSize =3D AsciiStrnLenS (binString, MAX_TEST_STRING_SIZE); >=20 > BinData =3D AllocatePool (BinSize); > + if (BinData =3D=3D NULL) { > + return UNIT_TEST_ERROR_TEST_FAILED; > + } > Btc->BufferToFree =3D BinData; >=20 > ReturnSize =3D BinSize; > -- > 2.17.1 >=20 >=20 >=20