]> The Tcpdump Group git mirrors - tcpdump/commitdiff
don't forget the boundary check, when dissecting an optional uptime parameter
authorhannes <hannes>
Sun, 10 Apr 2005 06:39:59 +0000 (06:39 +0000)
committerhannes <hannes>
Sun, 10 Apr 2005 06:39:59 +0000 (06:39 +0000)
print-chdlc.c

index cbd31d7ccdea4caf1d1022e07aba242a7e0fc93b..b1c67cfebff1072792279333e26894497ea0731b 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.34 2005-04-09 09:40:32 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.35 2005-04-10 06:39:59 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;