The implementation of IPsec.\r
\r
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, 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
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php.\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
on return.\r
@param[in] FragmentCount The number of fragments.\r
\r
- @retval EFI_SUCCESS The operation was successful.\r
- @retval EFI_OUT_OF_RESOURCES The required system resources can't be allocated.\r
-\r
**/\r
UINT8 *\r
IpSecTunnelOutboundPacket (\r
\r
if (IpVersion == IP_VERSION_4) {\r
InnerHead = AllocateZeroPool (sizeof (IP4_HEAD) + *OptionsLength);\r
- ASSERT (InnerHead != NULL);\r
+ if (InnerHead == NULL) {\r
+ return NULL;\r
+ }\r
+\r
CopyMem (\r
InnerHead,\r
IpHead,\r
);\r
} else {\r
InnerHead = AllocateZeroPool (sizeof (EFI_IP6_HEADER) + *OptionsLength);\r
- ASSERT (InnerHead != NULL);\r
+ if (InnerHead == NULL) {\r
+ return NULL;\r
+ }\r
+\r
CopyMem (\r
InnerHead,\r
IpHead,\r
IpSecOnRecyclePacket,\r
NULL\r
);\r
- ASSERT (Packet != NULL);\r
+ if (Packet == NULL) {\r
+ FreePool (InnerHead);\r
+ return NULL;\r
+ }\r
+\r
//\r
// 3. Check the Last Header, if it is TCP, UDP or ICMP recalcualate its pesudo\r
// CheckSum.\r