From a23f6be9ed28eafcfea2c2bd8a4664abea537c24 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Thu, 12 Nov 2009 00:02:17 +0000 Subject: fix read-one-beyond-of-array errors; ok sthen jsg --- usr.sbin/tcpdump/print-lldp.c | 4 ++-- usr.sbin/tcpdump/print-ppp.c | 4 ++-- usr.sbin/tcpdump/print-snmp.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.sbin/tcpdump/print-lldp.c b/usr.sbin/tcpdump/print-lldp.c index e7ce16e3af7..9123a9202ce 100644 --- a/usr.sbin/tcpdump/print-lldp.c +++ b/usr.sbin/tcpdump/print-lldp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-lldp.c,v 1.5 2007/10/26 18:18:13 moritz Exp $ */ +/* $OpenBSD: print-lldp.c,v 1.6 2009/11/12 00:02:16 deraadt Exp $ */ /* * Copyright (c) 2006 Reyk Floeter @@ -264,7 +264,7 @@ lldp_print(const u_char *p, u_int len) _ptrinc(sizeof(u_int8_t)); v = *ptr; _ptrinc(sizeof(u_int8_t)); - if (v <= AFNUM_MAX) + if (v < AFNUM_MAX) printf(" %s", afnumber[v]); else printf(" type %d", v); diff --git a/usr.sbin/tcpdump/print-ppp.c b/usr.sbin/tcpdump/print-ppp.c index 7654d538938..ed354151af3 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.21 2009/10/27 23:59:55 deraadt Exp $ */ +/* $OpenBSD: print-ppp.c,v 1.22 2009/11/12 00:02:16 deraadt Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997 @@ -325,7 +325,7 @@ print_lcp_config_options(p) int len = *(p+1); int opt = *p; - if((opt >= LCPOPT_MIN) && (opt <= LCPOPT_MAX)) + if((opt >= LCPOPT_MIN) && (opt < LCPOPT_MAX)) printf(", %s", lcpconfopts[opt]); switch(opt) { diff --git a/usr.sbin/tcpdump/print-snmp.c b/usr.sbin/tcpdump/print-snmp.c index 1f63238a17a..0d80d15a6f8 100644 --- a/usr.sbin/tcpdump/print-snmp.c +++ b/usr.sbin/tcpdump/print-snmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-snmp.c,v 1.16 2009/10/27 23:59:55 deraadt Exp $ */ +/* $OpenBSD: print-snmp.c,v 1.17 2009/11/12 00:02:16 deraadt Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997 @@ -188,7 +188,7 @@ char *GenericTrap[] = { #define GT_ENTERPRISE 6 }; #define DECODE_GenericTrap(t) \ - ( t >= 0 && t <= sizeof(GenericTrap)/sizeof(GenericTrap[0]) \ + ( t >= 0 && t < sizeof(GenericTrap)/sizeof(GenericTrap[0]) \ ? GenericTrap[t] : (snprintf(buf, sizeof(buf), "gt=%d", t), buf)) /* -- cgit v1.2.3