From: jsg Date: Tue, 2 Mar 2021 00:39:57 +0000 (+0000) Subject: off by one in bounds test X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3925bc35b44522afba14f5b041fa52995f300d31;p=openbsd off by one in bounds test ok sthen@ millert@ --- diff --git a/usr.sbin/tcpdump/print-ppp.c b/usr.sbin/tcpdump/print-ppp.c index 21f5d154847..7770b302c08 100644 --- a/usr.sbin/tcpdump/print-ppp.c +++ b/usr.sbin/tcpdump/print-ppp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ppp.c,v 1.34 2020/01/24 22:46:37 procter Exp $ */ +/* $OpenBSD: print-ppp.c,v 1.35 2021/03/02 00:39:57 jsg Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997 @@ -152,9 +152,6 @@ static const char *lcpcodes[] = { #define LCPOPT_PFC 7 #define LCPOPT_ACFC 8 -#define LCPOPT_MIN 0 -#define LCPOPT_MAX 24 - static char *lcpconfopts[] = { "Vendor-Ext", "Max-Rx-Unit", @@ -522,7 +519,7 @@ print_lcp_config_options(const u_char *p, int l) return (-1); type = p[0]; - if (type <= LCPOPT_MAX) + if (type < nitems(lcpconfopts)) printf(" %s", lcpconfopts[type]); else printf(" unknown-lcp-%u", type);