From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.109]) by mx.groups.io with SMTP id smtpd.web12.1202.1585071522634350610 for ; Tue, 24 Mar 2020 10:38:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=SCy+gTW9; spf=pass (domain: microsoft.com, ip: 40.107.244.109, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l6YrVzbylQM/gw4zNMy2Dh0dE5w+F2xQ5yKGeXWgCxesUY2J/Y137LR5Yzrn9s6cLuD0D86DcjLi/qKlQROTT4Jqldd2kxJHb9utUZ/WFSeLig3ib9e9JCtYZST9+pRTp5P2vXSvp8LxKWE0L6wNsySzxeqNmv0X8Zqj5Z7TWYBJz+bKyizGoRV+T6gV2p1J4knFH80oSsQ5OGNYJshyEsxfwPE4fZRdhfox9sqErApFT5LXkseBIp8hlQZNqQh2m25T/ZmWkiaorxfhVvUJuCGvA9fRWiM5Wn+F5qNX/M3VXOzxifUt3MpwpDp+R/l9DUnoXKLNbYAVf3PjHeUpCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nl/PCVI6bgrSH+kR/rXMClB4LNet+9JWifZrCn1ecjI=; b=KfcR9zSoXCEBSTF0QDwRz/+ALU7TNIhfmJGa4UlmItuCojcYq4DtJphszKU5Sybj2I8i0T1tX8m4283C/RQuLKxs92Vi9cP1scLbJhyG6OAXV69Ps+WHiHtDGUQM4v1T41sz2WpiIDVZvdLQOclhJhmT92Kd+qxlGOcud8QMsp/T9Ow0gDVSUo0+7RAqTsoZGn/cff6WljqVYjaUjZ2Fw5rIiUxcNp8Wy+tJSHEcITOs2JEIo2HkOwJqF6a33Cs/GYC17+FCaMwu+npa1PauZGARxN0iXHHFL/hhsbUMiDx5HE8THTty9J6W3sZpqPnLbGiwqIb5+HbCtKJzugB/Kg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nl/PCVI6bgrSH+kR/rXMClB4LNet+9JWifZrCn1ecjI=; b=SCy+gTW921lZXPGlL0OOcRtKaVC0y6gF7qpqjrJ4oz4d3I6GxZsL9XLAnxDNs6x10YKgBVKp2oScmuw+ImKdoD6B66asxaDaUIqzDiCczMhOMENWM2b1J8lQR7yCQEzwoJcsUrQ1Gtpag3adE5y43/I54DpEjTKgXaG74y6HgeU= Received: from CY4PR21MB0743.namprd21.prod.outlook.com (2603:10b6:903:b2::9) by CY4PR21MB0821.namprd21.prod.outlook.com (2603:10b6:903:b8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.2; Tue, 24 Mar 2020 17:38:41 +0000 Received: from CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318]) by CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318%10]) with mapi id 15.20.2878.000; Tue, 24 Mar 2020 17:38:40 +0000 From: "Bret Barkelew" To: "devel@edk2.groups.io" , "guomin.jiang@intel.com" CC: "Kinney, Michael D" , Liming Gao Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v4] MdePkg/UnitTestBaseLib: Add check for pointer BinData Thread-Topic: [EXTERNAL] [edk2-devel] [PATCH v4] MdePkg/UnitTestBaseLib: Add check for pointer BinData Thread-Index: AQHWAX2G+A4B/kc3HUixgAgknSAK06hYAw4Y Date: Tue, 24 Mar 2020 17:38:40 +0000 Message-ID: References: <20200324014241.194-1-guomin.jiang@intel.com> In-Reply-To: <20200324014241.194-1-guomin.jiang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-03-24T17:38:23.7825016Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bret.Barkelew@microsoft.com; x-originating-ip: [71.212.145.195] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 56a46cf6-ffa6-4b8a-0ab0-08d7d01a3135 x-ms-traffictypediagnostic: CY4PR21MB0821:|CY4PR21MB0821: x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1169; x-forefront-prvs: 03524FBD26 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(4636009)(346002)(136003)(376002)(396003)(39860400002)(366004)(52536014)(53546011)(6506007)(33656002)(66574012)(8936002)(76116006)(66476007)(66446008)(4326008)(71200400001)(186003)(8676002)(64756008)(66946007)(91956017)(66556008)(26005)(86362001)(81156014)(81166006)(10290500003)(5660300002)(55016002)(9686003)(966005)(7696005)(316002)(54906003)(478600001)(2906002)(8990500004)(110136005);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR21MB0821;H:CY4PR21MB0743.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: oIDWZm3PW1MsEq05AicXo7F5NPey8Xv9KlrcperlCJED9B9YNI2fe231w9/NVdMEdgFN2Ace0uh2Wmg2ip7B2QwBfxiqtltGduQB9HWP18RXwMAAobsof8UK9ZofIDaSPUzH3szRr13tVFqHF/2ybwiMr/koP0cm93SEwQkhyVKujdRUsyAXLHpJ+wGkYHvvUXVMGMIhoDBHaQcbIKSsHV09KDU5fhSxVKcw9GazIYbremB10Fw6qIsZjlztPcSOLkoyYzc8qKdVqhUBkicrKGhcxfZgR9ejSsuMtKyKJD4QqCoEJxJJZumYGV7fSP6QhUlzG3ZR5XKmYBeZXOpFx56nGmDHcIr0u2pA0ANgLKq0p+ip5EXB0ADm4frcqQp2Dbj0Lo/lo7ZX/etScttLadFbIGlBP5MFWTrQ84zKpcPS9KWsuNaWSZjyWyvFPTzx4iQuvE1i+I/0m88a5wriSw+WDlaGDj23sHWQgwzqtDty1aaZUo2gbiPBzkzvVwA0ieiBDDS2cMLLiyRt942N6w== x-ms-exchange-antispam-messagedata: bhfssVfHp3ZcW5FL3TxE4HxUq47Ne8rHXVGBfkachE4Mxwk5YuotU3ltaYqKdzP77WNC0M2D+AwX3CesTGOmr5grAOSdfnbQdnFz8J4RTnhmIwUZnGqsxpnq7EvY9Xut20tRbb7S+fE98GUppMw+bQ== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56a46cf6-ffa6-4b8a-0ab0-08d7d01a3135 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Mar 2020 17:38:40.8491 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 52RXhHDauGcS0KAznVQwlSDkE7NUlMm1xtTPwV04f+SLn9cTg4wbs5bPzJy1Gf5Wm8P2ZkvIwxKkzz8pdn6YyQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0821 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR21MB0743F5D7DA343B452FB263F5EFF10CY4PR21MB0743namp_" --_000_CY4PR21MB0743F5D7DA343B452FB263F5EFF10CY4PR21MB0743namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bret Barkelew - Bret ________________________________ From: devel@edk2.groups.io on behalf of Guomin Jiang= via Groups.Io Sent: Monday, March 23, 2020 6:42:41 PM To: devel@edk2.groups.io Cc: Kinney, Michael D ; Liming Gao Subject: [EXTERNAL] [edk2-devel] [PATCH v4] MdePkg/UnitTestBaseLib: Add che= ck for pointer BinData REF: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbu= gzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2531&data=3D02%7C01%7Cbret.b= arkelew%40microsoft.com%7C6522fbf200f848652e0508d7cf94a6e3%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637206109682048750&sdata=3DQwoKvxc7kKhrL0d= 00VidlcmAUV52ERnXnvjZl%2B30iBo%3D&reserved=3D0 AllocatePool may fail and BinData may be invalid, check it before use. Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Guomin Jiang --- MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c b/MdePkg= /Test/UnitTest/Library/BaseLib/Base64UnitTest.c index 6f7c31cab4..8952f9da6c 100644 --- a/MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c +++ b/MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c @@ -252,9 +252,11 @@ RfcDecodeTest( BinSize =3D AsciiStrnLenS (binString, MAX_TEST_STRING_SIZE); BinData =3D AllocatePool (BinSize); - Btc->BufferToFree =3D BinData; + UT_ASSERT_NOT_NULL(BinData); + Btc->BufferToFree =3D BinData; ReturnSize =3D BinSize; + Status =3D Base64Decode (b64String, b64StringLen, BinData, &ReturnSize); UT_ASSERT_STATUS_EQUAL (Status, Btc->ExpectedStatus); -- 2.25.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56125): https://nam06.safelinks.protection.outlook.com/= ?url=3Dhttps%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F56125&data= =3D02%7C01%7Cbret.barkelew%40microsoft.com%7C6522fbf200f848652e0508d7cf94a6= e3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637206109682058707&sdat= a=3DJDn7W7TIK1N88KwHk%2FUfPlBr2K7ZZWXSHuHi8g4hFzQ%3D&reserved=3D0 Mute This Topic: https://nam06.safelinks.protection.outlook.com/?url=3Dhttp= s%3A%2F%2Fgroups.io%2Fmt%2F72508893%2F1852292&data=3D02%7C01%7Cbret.bar= kelew%40microsoft.com%7C6522fbf200f848652e0508d7cf94a6e3%7C72f988bf86f141af= 91ab2d7cd011db47%7C1%7C0%7C637206109682058707&sdata=3DS%2FvxBwgQopFui1%= 2FiSzYWl2svWyrik8%2FoBr3nBHDtlN4%3D&reserved=3D0 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A= %2F%2Fedk2.groups.io%2Fg%2Fdevel%2Funsub&data=3D02%7C01%7Cbret.barkelew= %40microsoft.com%7C6522fbf200f848652e0508d7cf94a6e3%7C72f988bf86f141af91ab2= d7cd011db47%7C1%7C0%7C637206109682058707&sdata=3DcqEooo1lTCAXYRPN6CQhdK= cGRXTC4XTZMz7FSl6Zq8I%3D&reserved=3D0 [bret.barkelew@microsoft.com] -=3D-=3D-=3D-=3D-=3D-=3D --_000_CY4PR21MB0743F5D7DA343B452FB263F5EFF10CY4PR21MB0743namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Reviewed-by: Bret Barkelew <bret.barkelew@microso= ft.com>

 

- Bret

 


From: devel@edk2.groups.io = <devel@edk2.groups.io> on behalf of Guomin Jiang via Groups.Io <gu= omin.jiang=3Dintel.com@groups.io>
Sent: Monday, March 23, 2020 6:42:41 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Liming Gao= <liming.gao@intel.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v4] MdePkg/UnitTestBaseLib: = Add check for pointer BinData
 
REF: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzill= a.tianocore.org%2Fshow_bug.cgi%3Fid%3D2531&amp;data=3D02%7C01%7Cbret.ba= rkelew%40microsoft.com%7C6522fbf200f848652e0508d7cf94a6e3%7C72f988bf86f141a= f91ab2d7cd011db47%7C1%7C0%7C637206109682048750&amp;sdata=3DQwoKvxc7kKhr= L0d00VidlcmAUV52ERnXnvjZl%2B30iBo%3D&amp;reserved=3D0

AllocatePool may fail and BinData may be invalid, check it before use.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c | 4 ++&= #43;-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c b/MdePkg= /Test/UnitTest/Library/BaseLib/Base64UnitTest.c
index 6f7c31cab4..8952f9da6c 100644
--- a/MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c
+++ b/MdePkg/Test/UnitTest/Library/BaseLib/Base64UnitTest.c
@@ -252,9 +252,11 @@ RfcDecodeTest(
   BinSize =3D AsciiStrnLenS (binString, MAX_TEST_STRING_SIZE);
 

   BinData =3D AllocatePool (BinSize);

-  Btc->BufferToFree =3D BinData;

+  UT_ASSERT_NOT_NULL(BinData);

 

+  Btc->BufferToFree =3D BinData;

   ReturnSize =3D BinSize;

+

   Status =3D Base64Decode (b64String, b64StringLen, BinData, &am= p;ReturnSize);

 

   UT_ASSERT_STATUS_EQUAL (Status, Btc->ExpectedStatus);

--
2.25.1.windows.1


-=3D-=3D-=3D-=3D-=3D-=3D
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#56125): https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fedk2.gr= oups.io%2Fg%2Fdevel%2Fmessage%2F56125&amp;data=3D02%7C01%7Cbret.barkele= w%40microsoft.com%7C6522fbf200f848652e0508d7cf94a6e3%7C72f988bf86f141af91ab= 2d7cd011db47%7C1%7C0%7C637206109682058707&amp;sdata=3DJDn7W7TIK1N88KwHk= %2FUfPlBr2K7ZZWXSHuHi8g4hFzQ%3D&amp;reserved=3D0
Mute This Topic: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgroups.= io%2Fmt%2F72508893%2F1852292&amp;data=3D02%7C01%7Cbret.barkelew%40micro= soft.com%7C6522fbf200f848652e0508d7cf94a6e3%7C72f988bf86f141af91ab2d7cd011d= b47%7C1%7C0%7C637206109682058707&amp;sdata=3DS%2FvxBwgQopFui1%2FiSzYWl2= svWyrik8%2FoBr3nBHDtlN4%3D&amp;reserved=3D0
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fedk2.gr= oups.io%2Fg%2Fdevel%2Funsub&amp;data=3D02%7C01%7Cbret.barkelew%40micros= oft.com%7C6522fbf200f848652e0508d7cf94a6e3%7C72f988bf86f141af91ab2d7cd011db= 47%7C1%7C0%7C637206109682058707&amp;sdata=3DcqEooo1lTCAXYRPN6CQhdKcGRXT= C4XTZMz7FSl6Zq8I%3D&amp;reserved=3D0  [bret.barkelew@microsoft.com]
-=3D-=3D-=3D-=3D-=3D-=3D

--_000_CY4PR21MB0743F5D7DA343B452FB263F5EFF10CY4PR21MB0743namp_--