From: jsg Date: Thu, 23 Dec 2021 09:15:59 +0000 (+0000) Subject: fix off by one in bounds test X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=34f94cc6b9fa3f54ffb70a5e7de8c98e44bbbb8d;p=openbsd fix off by one in bounds test ok tobhe@ --- 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); }