]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/VariableAuthenticated/RuntimeDxe/AuthService.c
Add error handling code to prevent variable store corruption in release build.
[mirror_edk2.git] / SecurityPkg / VariableAuthenticated / RuntimeDxe / AuthService.c
index 8552d31b252f9f30b8d6000740425753912f0d3f..6f8808a756f67d8c036db67e436465f2a1b80221 100644 (file)
@@ -445,6 +445,10 @@ AddPubKeyInStore (
              FALSE\r
              );\r
   ASSERT_EFI_ERROR (Status);\r
+  if (EFI_ERROR (Status)) {\r
+    return 0;\r
+  }\r
+\r
   //\r
   // Check whether the public key entry does exist.\r
   //\r
@@ -492,6 +496,9 @@ AddPubKeyInStore (
                  FALSE\r
                  );\r
       ASSERT_EFI_ERROR (Status);\r
+      if (EFI_ERROR (Status)) {\r
+        return 0;\r
+      }\r
 \r
       DataSize  = DataSizeOfVariable (Variable.CurrPtr);\r
       Data      = GetVariableDataPtr (Variable.CurrPtr);\r