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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user