From: tobhe Date: Sun, 14 Jul 2024 13:13:33 +0000 (+0000) Subject: Fail explicitly on unexptected imsg->hdr_type. Otherwise the following X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f294d01ebd825ba95d9a2cd0f609578eac0baf4f;p=openbsd Fail explicitly on unexptected imsg->hdr_type. Otherwise the following comparison is undefined. --- diff --git a/sbin/iked/vroute.c b/sbin/iked/vroute.c index 5ef892d61ab..1e05d36cf70 100644 --- a/sbin/iked/vroute.c +++ b/sbin/iked/vroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vroute.c,v 1.19 2023/06/13 12:34:12 tb Exp $ */ +/* $OpenBSD: vroute.c,v 1.20 2024/07/14 13:13:33 tobhe Exp $ */ /* * Copyright (c) 2021 Tobias Heider @@ -631,6 +631,8 @@ vroute_getroute(struct iked *env, struct imsg *imsg) case IMSG_VROUTE_DEL: type = RTM_DELETE; break; + default: + return (-1); } if (type == RTM_ADD)