From 6222063384da4eb07df56d94aee0e020149f0de0 Mon Sep 17 00:00:00 2001 From: tobhe Date: Mon, 14 Aug 2023 11:55:03 +0000 Subject: [PATCH] Add explicit NULL checks for sa_cp_addr and sa_cp_addr6. --- sbin/iked/policy.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 @@ -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: -- 2.20.1