NetworkPkg: Avoid potential NULL pointer dereference
The commit of 6b16c9e7
removes ASSERT and use error handling
in IpSecDxe driver, but may cause the potential NULL pointer
dereference. So, this patch is used to avoid NULL pointer
dereference.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The general interfaces of the IKEv2.
|
||||
|
||||
Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
@@ -495,6 +495,10 @@ Ikev2HandleSa (
|
||||
IsListEmpty (&IkeSaSession->ChildSaEstablishSessionList));
|
||||
|
||||
ChildSaSession = Ikev2ChildSaSessionCreate (IkeSaSession, UdpService);
|
||||
if (ChildSaSession == NULL) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
ChildSaCommon = &ChildSaSession->SessionCommon;
|
||||
}
|
||||
|
||||
@@ -519,6 +523,10 @@ Ikev2HandleSa (
|
||||
IsListEmpty (&IkeSaSession->ChildSaEstablishSessionList));
|
||||
|
||||
ChildSaSession = Ikev2ChildSaSessionCreate (IkeSaSession, UdpService);
|
||||
if (ChildSaSession == NULL) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
ChildSaCommon = &ChildSaSession->SessionCommon;
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user