From: ydong10 Date: Thu, 12 Apr 2012 09:02:52 +0000 (+0000) Subject: Add check before using it to avoid access violation. X-Git-Tag: edk2-stable201903~13497 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=bef3fd0c68eed51708dcce83443b83ac08b29eff;ds=sidebyside Add check before using it to avoid access violation. Signed-off-by: Dong Eric git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13192 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c b/NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c index 05df9fa919..7e04573022 100644 --- a/NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c +++ b/NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c @@ -814,6 +814,7 @@ CreateSadEntry ( if (ValueStr != NULL) { (*Data)->AlgoInfo.EspAlgoInfo.AuthKeyLength = AuthKeyLength; AsciiStr = AllocateZeroPool (AuthKeyLength + 1); + ASSERT (AsciiStr != NULL); UnicodeStrToAsciiStr (ValueStr, AsciiStr); CopyMem ((*Data)->AlgoInfo.EspAlgoInfo.AuthKey, AsciiStr, AuthKeyLength); FreePool (AsciiStr);