From: "Bret Barkelew" <bret.barkelew@microsoft.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"guomin.jiang@intel.com" <guomin.jiang@intel.com>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>,
Liming Gao <liming.gao@intel.com>
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v4] MdePkg/UnitTestBaseLib: Add check for pointer BinData
Date: Tue, 24 Mar 2020 17:38:40 +0000 [thread overview]
Message-ID: <CY4PR21MB0743F5D7DA343B452FB263F5EFF10@CY4PR21MB0743.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20200324014241.194-1-guomin.jiang@intel.com>
[-- Attachment #1: Type: text/plain, Size: 3141 bytes --]
Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
- Bret
________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Guomin Jiang via Groups.Io <guomin.jiang=intel.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=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2531&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C6522fbf200f848652e0508d7cf94a6e3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637206109682048750&sdata=QwoKvxc7kKhrL0d00VidlcmAUV52ERnXnvjZl%2B30iBo%3D&reserved=0
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 +++-
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 = AsciiStrnLenS (binString, MAX_TEST_STRING_SIZE);
BinData = AllocatePool (BinSize);
- Btc->BufferToFree = BinData;
+ UT_ASSERT_NOT_NULL(BinData);
+ Btc->BufferToFree = BinData;
ReturnSize = BinSize;
+
Status = Base64Decode (b64String, b64StringLen, BinData, &ReturnSize);
UT_ASSERT_STATUS_EQUAL (Status, Btc->ExpectedStatus);
--
2.25.1.windows.1
-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#56125): https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F56125&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C6522fbf200f848652e0508d7cf94a6e3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637206109682058707&sdata=JDn7W7TIK1N88KwHk%2FUfPlBr2K7ZZWXSHuHi8g4hFzQ%3D&reserved=0
Mute This Topic: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.io%2Fmt%2F72508893%2F1852292&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C6522fbf200f848652e0508d7cf94a6e3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637206109682058707&sdata=S%2FvxBwgQopFui1%2FiSzYWl2svWyrik8%2FoBr3nBHDtlN4%3D&reserved=0
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Funsub&data=02%7C01%7Cbret.barkelew%40microsoft.com%7C6522fbf200f848652e0508d7cf94a6e3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637206109682058707&sdata=cqEooo1lTCAXYRPN6CQhdKcGRXTC4XTZMz7FSl6Zq8I%3D&reserved=0 [bret.barkelew@microsoft.com]
-=-=-=-=-=-=
[-- Attachment #2: Type: text/html, Size: 6661 bytes --]
prev parent reply other threads:[~2020-03-24 17:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-24 1:42 [PATCH v4] MdePkg/UnitTestBaseLib: Add check for pointer BinData Guomin Jiang
2020-03-24 15:52 ` Michael D Kinney
2020-03-24 17:38 ` Bret Barkelew [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CY4PR21MB0743F5D7DA343B452FB263F5EFF10@CY4PR21MB0743.namprd21.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox