/** @file\r
The general interfaces of the IKEv2.\r
\r
- Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 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
IsListEmpty (&IkeSaSession->ChildSaEstablishSessionList));\r
\r
ChildSaSession = Ikev2ChildSaSessionCreate (IkeSaSession, UdpService);\r
+ if (ChildSaSession == NULL) {\r
+ goto ON_ERROR;\r
+ }\r
+\r
ChildSaCommon = &ChildSaSession->SessionCommon;\r
}\r
\r
IsListEmpty (&IkeSaSession->ChildSaEstablishSessionList));\r
\r
ChildSaSession = Ikev2ChildSaSessionCreate (IkeSaSession, UdpService);\r
+ if (ChildSaSession == NULL) {\r
+ goto ON_ERROR;\r
+ }\r
+\r
ChildSaCommon = &ChildSaSession->SessionCommon;\r
\r
//\r
//\r
// Generate the reply packet if needed and send it out.\r
//\r
- if (IkePacket->Header->Flags != IKE_HEADER_FLAGS_RESPOND) {\r
+ if (!(IkePacket->Header->Flags & IKE_HEADER_FLAGS_RESPOND)) {\r
Reply = mIkev2CreateChild.Generator ((UINT8 *) IkeSaSession, &IkePacket->Header->MessageId);\r
if (Reply != NULL) {\r
Status = Ikev2SendIkePacket (UdpService, (UINT8 *) &(IkeSaSession->SessionCommon), Reply, 0);\r