summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Heider <tobhe@cvs.openbsd.org>2023-08-14 11:55:04 +0000
committerTobias Heider <tobhe@cvs.openbsd.org>2023-08-14 11:55:04 +0000
commit2dc9e68c884da39681b395532c3bc1787abda8e5 (patch)
tree5fd705cf509f1619aa9d98d733690914fc596181
parent19c253688069721d4cde6584930c9e3b9e6504f9 (diff)
Add explicit NULL checks for sa_cp_addr and sa_cp_addr6.
-rw-r--r--sbin/iked/policy.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/iked/policy.c b/sbin/iked/policy.c
index 0048b4a9281..dc6b3e76803 100644
--- a/sbin/iked/policy.c
+++ b/sbin/iked/policy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: policy.c,v 1.95 2023/06/13 12:34:12 tb Exp $ */
+/* $OpenBSD: policy.c,v 1.96 2023/08/14 11:55:03 tobhe Exp $ */
/*
* Copyright (c) 2020-2021 Tobias Heider <tobhe@openbsd.org>
@@ -737,9 +737,13 @@ sa_configure_iface(struct iked *env, struct iked_sa *sa, int add)
switch(saflow->flow_src.addr_af) {
case AF_INET:
+ if (sa->sa_cp_addr == NULL)
+ continue;
caddr = (struct sockaddr *)&sa->sa_cp_addr->addr;
break;
case AF_INET6:
+ if (sa->sa_cp_addr6 == NULL)
+ continue;
caddr = (struct sockaddr *)&sa->sa_cp_addr6->addr;
break;
default: