diff options
| author | 2006-05-28 21:20:16 +0000 | |
|---|---|---|
| committer | 2006-05-28 21:20:16 +0000 | |
| commit | 611f1ac1a0d15bc36b663db032a1a1ff786a586a (patch) | |
| tree | 9ac7519178b60907f44499cd5d20670e7ecc7021 | |
| parent | add basic 'cvs log' support. (diff) | |
| download | wireguard-openbsd-611f1ac1a0d15bc36b663db032a1a1ff786a586a.tar.xz wireguard-openbsd-611f1ac1a0d15bc36b663db032a1a1ff786a586a.zip | |
Check that a complete struct llc was captured (not only 3 bytes),
because it is accessed later on.
ok deraadt@
| -rw-r--r-- | usr.sbin/tcpdump/print-llc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/print-llc.c b/usr.sbin/tcpdump/print-llc.c index addc261dfd9..b5aa7c5a54d 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: /home/cvs/src/usr.sbin/tcpdump/print-llc.c,v 1.14 2004/12/20 08:30:40 pascoe Exp $"; + "@(#) $Header: /home/cvs/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); |
