From: hannes Date: Sun, 10 Apr 2005 06:42:54 +0000 (+0000) Subject: don't forget the boundary check, when dissecting an optional uptime parameter X-Git-Tag: tcpdump-3.9.1~158 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/9ae2257cf4874d66fa19cee3cc0fe9a492410afc don't forget the boundary check, when dissecting an optional uptime parameter --- diff --git a/print-chdlc.c b/print-chdlc.c index 65437d1c..295dab3e 100644 --- a/print-chdlc.c +++ b/print-chdlc.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.32.2.2 2005-04-09 09:42:25 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.32.2.3 2005-04-10 06:42:54 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -163,6 +163,8 @@ chdlc_slarp_print(const u_char *cp, u_int length) EXTRACT_16BITS(&slarp->un.keep.rel)); if (length >= SLARP_LEN) { /* uptime-stamp is optional */ + if (!TTEST2(slarp->un.keep.time, 4)) + goto trunc; sec = EXTRACT_32BITS(&slarp->un.keep.time) / 1000; min = sec / 60; sec -= min * 60; hrs = min / 60; min -= hrs * 60;