aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAtzm Watanabe <atzmism@gmail.com>2022-08-05 18:48:25 +0900
committerBeno�t Ganne <bganne@cisco.com>2022-08-18 06:31:52 +0000
commit138f65c5b7796c6401cde6ff92edc85f02c367a4 (patch)
tree9938594dd1a8021ad11228d9ff63afc7b3f31988 /src
parent3ebe1efce1a75b669bfcab905e8bb6759cdc3831 (diff)
ikev2: fix possible SEGV
Type: fix Signed-off-by: Atzm Watanabe <atzmism@gmail.com> Change-Id: Icbd452b43ecaafe46def1276c98f7e8cbf761e51
Diffstat (limited to 'src')
-rw-r--r--src/plugins/ikev2/ikev2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/ikev2/ikev2.c b/src/plugins/ikev2/ikev2.c
index f8b9c6fb04b..5c1aa58814e 100644
--- a/src/plugins/ikev2/ikev2.c
+++ b/src/plugins/ikev2/ikev2.c
@@ -3338,12 +3338,12 @@ ikev2_node_internal (vlib_main_t *vm, vlib_node_runtime_t *node,
goto dispatch0;
}
- if (sa0->rekey)
+ if (vec_len (sa0->rekey) > 0)
{
if (!sa0->rekey[0].notify_type &&
sa0->rekey[0].protocol_id != IKEV2_PROTOCOL_IKE)
{
- if (sa0->childs)
+ if (vec_len (sa0->childs) > 0)
ikev2_sa_free_all_child_sa (&sa0->childs);
ikev2_child_sa_t *child;
vec_add2 (sa0->childs, child, 1);
@@ -3372,7 +3372,7 @@ ikev2_node_internal (vlib_main_t *vm, vlib_node_runtime_t *node,
1);
}
}
- else if (sa0->new_child)
+ else if (vec_len (sa0->new_child) > 0)
{
ikev2_child_sa_t *c;
vec_add2 (sa0->childs, c, 1);