Add error handling code to prevent variable store corruption in release build.

Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting  <ting.ye@intel.com>
Reviewed-by: Dong Guo <guo.dong@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14139 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
sfu5
2013-02-21 01:35:22 +00:00
parent fb5278ef78
commit ca5a7d87e3
3 changed files with 43 additions and 28 deletions

View File

@@ -445,6 +445,10 @@ AddPubKeyInStore (
FALSE
);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
return 0;
}
//
// Check whether the public key entry does exist.
//
@@ -492,6 +496,9 @@ AddPubKeyInStore (
FALSE
);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
return 0;
}
DataSize = DataSizeOfVariable (Variable.CurrPtr);
Data = GetVariableDataPtr (Variable.CurrPtr);