]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/IpSecDxe/IpSecConfigImpl.c
BaseTools/tools_def IA32: disable PIE code generation explicitly
[mirror_edk2.git] / NetworkPkg / IpSecDxe / IpSecConfigImpl.c
index e1b24e4355574e0637bdd7fa34917ad050b949df..4a51bff96f420bf2cbb7a95576f6051f6949a87c 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The implementation of IPSEC_CONFIG_PROTOCOL.\r
 \r
-  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2017, 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
@@ -1152,7 +1152,7 @@ SetSpdEntry (
   // Do Padding for the different Arch.\r
   //\r
   SpdEntrySize  = ALIGN_VARIABLE (sizeof (IPSEC_SPD_ENTRY));\r
-  SpdEntrySize  = ALIGN_VARIABLE (SpdEntrySize + (UINTN)SIZE_OF_SPD_SELECTOR (SpdSel));\r
+  SpdEntrySize  = ALIGN_VARIABLE (SpdEntrySize + SIZE_OF_SPD_SELECTOR (SpdSel));\r
   SpdEntrySize += IpSecGetSizeOfEfiSpdData (SpdData);\r
 \r
   SpdEntry = AllocateZeroPool (SpdEntrySize);\r
@@ -1357,7 +1357,7 @@ SetSadEntry (
   }\r
 \r
   if (SaData->SpdSelector != NULL) {\r
-    SadEntrySize += SadEntrySize + (UINTN)SIZE_OF_SPD_SELECTOR (SaData->SpdSelector);\r
+    SadEntrySize += SadEntrySize + SIZE_OF_SPD_SELECTOR (SaData->SpdSelector);\r
   }\r
   SadEntry      = AllocateZeroPool (SadEntrySize);\r
 \r
@@ -1458,7 +1458,7 @@ SetSadEntry (
       SadEntry->Data->SpdEntry = SpdEntry;\r
       SadEntry->Data->SpdSelector = (EFI_IPSEC_SPD_SELECTOR *)((UINT8 *)SadEntry +\r
                                                                 SadEntrySize -\r
-                                                                (UINTN)SIZE_OF_SPD_SELECTOR (SaData->SpdSelector)\r
+                                                                SIZE_OF_SPD_SELECTOR (SaData->SpdSelector)\r
                                                                 );\r
       DuplicateSpdSelector (\r
        (EFI_IPSEC_CONFIG_SELECTOR *) SadEntry->Data->SpdSelector,\r
@@ -2175,7 +2175,10 @@ IpSecGetVariable (
   VariableNameLength  = StrLen (VariableName);\r
   VariableNameISize   = (VariableNameLength + 5) * sizeof (CHAR16);\r
   VariableNameI       = AllocateZeroPool (VariableNameISize);\r
-  ASSERT (VariableNameI != NULL);\r
+  if (VariableNameI == NULL) {\r
+    Status = EFI_OUT_OF_RESOURCES;\r
+    goto ON_EXIT;\r
+  }\r
   \r
   //\r
   // Construct the varible name of ipsecconfig meta data.\r