summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump/print-llc.c
diff options
context:
space:
mode:
authorMoritz Jodeit <moritz@cvs.openbsd.org>2006-05-28 21:20:17 +0000
committerMoritz Jodeit <moritz@cvs.openbsd.org>2006-05-28 21:20:17 +0000
commitb7ad0a3b85b43a1f78fde5b0188843c6bdba2a65 (patch)
tree1bb0c14386acc1fec97ae903f3f459e4faf96898 /usr.sbin/tcpdump/print-llc.c
parentd83f21246935bfa2da8280ce9cc845c79eb78a01 (diff)
Check that a complete struct llc was captured (not only 3 bytes),
because it is accessed later on. ok deraadt@
Diffstat (limited to 'usr.sbin/tcpdump/print-llc.c')
-rw-r--r--usr.sbin/tcpdump/print-llc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/print-llc.c b/usr.sbin/tcpdump/print-llc.c
index 0cf1ed27f56..6bcdf365fc7 100644
--- a/usr.sbin/tcpdump/print-llc.c
+++ b/usr.sbin/tcpdump/print-llc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-llc.c,v 1.14 2004/12/20 08:30:40 pascoe Exp $ */
+/* $OpenBSD: print-llc.c,v 1.15 2006/05/28 21:20:16 moritz Exp $ */
/*
* Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-llc.c,v 1.14 2004/12/20 08:30:40 pascoe Exp $";
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-llc.c,v 1.15 2006/05/28 21:20:16 moritz Exp $";
#endif
#include <sys/param.h>
@@ -73,7 +73,7 @@ llc_print(const u_char *p, u_int length, u_int caplen,
#endif
register int ret;
- if (caplen < 3) {
+ if (caplen < sizeof(struct llc)) {
(void)printf("[|llc]");
default_print((u_char *)p, caplen);
return(0);