From 9e3a0994785117a30e31014fcf37685d3e34e0f0 Mon Sep 17 00:00:00 2001 From: abs Date: Thu, 11 Feb 1999 07:52:14 +0000 Subject: [PATCH] How I managed to generate bizarre sap packets is one thing, but they did show up a case where tcpdump tries to access pass the end of a packet. --- usr.sbin/tcpdump/print-llc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr.sbin/tcpdump/print-llc.c b/usr.sbin/tcpdump/print-llc.c index 834dd30cf1d6..cbb5e1ac1651 100644 --- a/usr.sbin/tcpdump/print-llc.c +++ b/usr.sbin/tcpdump/print-llc.c @@ -1,4 +1,4 @@ -/* $NetBSD: print-llc.c,v 1.3 1997/10/03 19:55:23 christos Exp $ */ +/* $NetBSD: print-llc.c,v 1.4 1999/02/11 07:52:14 abs Exp $ */ /* * Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997 @@ -30,7 +30,7 @@ static const char rcsid[] = "@(#) Header: print-llc.c,v 1.24 97/01/01 20:56:48 leres Exp "; #else -__RCSID("$NetBSD: print-llc.c,v 1.3 1997/10/03 19:55:23 christos Exp $"); +__RCSID("$NetBSD: print-llc.c,v 1.4 1999/02/11 07:52:14 abs Exp $"); #endif #endif @@ -152,6 +152,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;