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]
-=-=-=-=-=-=