]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/IpSecDxe/IpSecCryptIo.c
NetworkPkg: Remove ASSERT and use error handling in IpSecDxe
[mirror_edk2.git] / NetworkPkg / IpSecDxe / IpSecCryptIo.c
index 8396c5900391651e435f42e4b9188ac228311a1e..dca44231be023a18b520d11ea92c181413218994 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Common interfaces to call Security library.\r
 \r
-  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -968,7 +968,10 @@ IpSecCryptoIoGetPublicKeyFromCert (
   RsaGetKey (RsaContext, RsaKeyN, NULL, PublicKeyLen);\r
  \r
   *PublicKey = AllocateZeroPool (*PublicKeyLen);\r
-  ASSERT (*PublicKey != NULL);\r
+  if (*PublicKey == NULL) {\r
+    Status = EFI_OUT_OF_RESOURCES;\r
+    goto EXIT;\r
+  }\r
 \r
   if (!RsaGetKey (RsaContext, RsaKeyN, *PublicKey, PublicKeyLen)) {\r
     Status = EFI_INVALID_PARAMETER;\r