summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-02-12 05:34:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-02-12 05:34:54 +0000
commit114e044514e8c62b4db7e7e11903c30ac5e3ea6e (patch)
tree9f04ab1b6d3c248e264115d8ce97fb218f0397bd
parent7a589c955d22618700decdf8642330b2b1a73f73 (diff)
do not go past end of packet; abs@netbsd
-rw-r--r--usr.sbin/tcpdump/print-llc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/tcpdump/print-llc.c b/usr.sbin/tcpdump/print-llc.c
index 2b24f602f72..b410c758557 100644
--- a/usr.sbin/tcpdump/print-llc.c
+++ b/usr.sbin/tcpdump/print-llc.c
@@ -24,7 +24,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-llc.c,v 1.6 1997/07/23 02:59:02 denny Exp $";
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-llc.c,v 1.7 1999/02/12 05:34:53 deraadt Exp $";
#endif
#include <sys/param.h>
@@ -164,6 +164,10 @@ llc_print(const u_char *p, u_int length, u_int caplen,
printf("%s/%c", m, f);
+ if (caplen < 6) {
+ default_print_unaligned(p, caplen);
+ return (0);
+ }
p += 3;
length -= 3;
caplen -= 3;