Add check before using it to avoid access violation.

Signed-off-by: Dong Eric <eric.dong@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13192 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10 2012-04-12 09:02:52 +00:00
parent 3c48e853eb
commit bef3fd0c68
1 changed files with 1 additions and 0 deletions

View File

@ -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);