diff options
author | 2021-03-02 00:39:57 +0000 | |
---|---|---|
committer | 2021-03-02 00:39:57 +0000 | |
commit | 3925bc35b44522afba14f5b041fa52995f300d31 (patch) | |
tree | c58ca0ddeb2153ed0294a71c9981b204b2132497 | |
parent | sync for perl 5.32.1 (diff) | |
download | wireguard-openbsd-3925bc35b44522afba14f5b041fa52995f300d31.tar.xz wireguard-openbsd-3925bc35b44522afba14f5b041fa52995f300d31.zip |
off by one in bounds test
ok sthen@ millert@
-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); |