From b6ed1e80d073e461202b99969089755556f9e90e Mon Sep 17 00:00:00 2001 From: tobhe Date: Sat, 20 Feb 2021 22:00:32 +0000 Subject: [PATCH] Fail on invalid address family. --- sbin/iked/ikev2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/iked/ikev2.c b/sbin/iked/ikev2.c index 5ca65079926..7ba9b170e87 100644 --- a/sbin/iked/ikev2.c +++ b/sbin/iked/ikev2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ikev2.c,v 1.309 2021/02/18 22:00:31 tobhe Exp $ */ +/* $OpenBSD: ikev2.c,v 1.310 2021/02/20 22:00:32 tobhe Exp $ */ /* * Copyright (c) 2019 Tobias Heider @@ -6905,6 +6905,8 @@ ikev2_cp_setaddr_pool(struct iked *env, struct iked_sa *sa, memcpy(&in6->sin6_addr.s6_addr[12], &nhost, sizeof(uint32_t)); break; + default: + return (-1); } if ((addr.addr_af == AF_INET && !RB_FIND(iked_addrpool, &env->sc_addrpool, &key)) || -- 2.20.1