]> The Tcpdump Group git mirrors - tcpdump/commitdiff
bugfix: do not attempt to decode zero-length TLVs, only attempt to decode IS-REACH...
authorhannes <hannes>
Mon, 25 Apr 2005 09:11:04 +0000 (09:11 +0000)
committerhannes <hannes>
Mon, 25 Apr 2005 09:11:04 +0000 (09:11 +0000)
print-isoclns.c

index 667565197c7b0df2bc7ef53cc05e314151a4047a..9ffe912d125b8fd769c07a32564fa3f5d0172233 100644 (file)
@@ -26,7 +26,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.133.2.1 2005-04-25 08:43:06 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.133.2.2 2005-04-25 09:11:04 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -1905,6 +1905,9 @@ static int isis_print (const u_int8_t *p, u_int length)
                tlv_type,
                tlv_len);
 
+        if (tlv_len == 0) /* something is malformed */
+            break;
+
         /* now check if we have a decoder otherwise do a hexdump at the end*/
        switch (tlv_type) {
        case ISIS_TLV_AREA_ADDR:
@@ -1935,7 +1938,7 @@ static int isis_print (const u_int8_t *p, u_int length)
            break;
 
         case ISIS_TLV_ISNEIGH_VARLEN:
-            if (!TTEST2(*tptr, 1))
+            if (!TTEST2(*tptr, 1) && tmp > 1)
                goto trunctlv;
            lan_alen = *tptr++; /* LAN address length */
            if (lan_alen == 0) {