From 34f94cc6b9fa3f54ffb70a5e7de8c98e44bbbb8d Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 23 Dec 2021 09:15:59 +0000 Subject: [PATCH] fix off by one in bounds test ok tobhe@ --- sbin/iked/parse.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/iked/parse.y b/sbin/iked/parse.y index 881d4aa901c..c714e569b50 100644 --- a/sbin/iked/parse.y +++ b/sbin/iked/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.138 2021/12/01 16:42:13 deraadt Exp $ */ +/* $OpenBSD: parse.y,v 1.139 2021/12/23 09:15:59 jsg Exp $ */ /* * Copyright (c) 2019 Tobias Heider @@ -2488,7 +2488,7 @@ create_ike(char *name, int af, struct ipsec_addr_wrap *ipproto, pol.pol_af = af; pol.pol_saproto = saproto; for (i = 0, ipp = ipproto; ipp; ipp = ipp->next, i++) { - if (i > IKED_IPPROTO_MAX) { + if (i >= IKED_IPPROTO_MAX) { yyerror("too many protocols"); return (-1); } -- 2.20.1