diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-03-02 00:39:58 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-03-02 00:39:58 +0000 |
commit | 82538c4b97b7747743a9481505224622ef7e3b6d (patch) | |
tree | 7e2fb4c903ab62451ebfab5085d22a2d8e9fd96f /usr.sbin/tcpdump | |
parent | b1c16f6fb3f0406ded89b4886fca861aa596c6f7 (diff) |
off by one in bounds test
ok sthen@ millert@
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r-- | usr.sbin/tcpdump/print-ppp.c | 7 |
1 files changed, 2 insertions, 5 deletions
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); |