]> The Tcpdump Group git mirrors - tcpdump/commitdiff
IS-IS: fix Interface Switching Capability sub-TLV too
authorDenis Ovsienko <[email protected]>
Wed, 16 Aug 2017 22:22:45 +0000 (23:22 +0100)
committerDenis Ovsienko <[email protected]>
Wed, 13 Sep 2017 11:25:44 +0000 (12:25 +0100)
Make a couple more fixes in isis_print_is_reach_subtlv() with the same
reasoning as in the previous commit. This bugfix is based on a code
inspection so comes without a test case.

print-isoclns.c

index 0db8fc10aee226c8b01869d20b770111616eaf93..5e08c3c2a516933f4b52973ad99220f9bf72a3d5 100644 (file)
@@ -1931,13 +1931,15 @@ isis_print_is_reach_subtlv(netdissect_options *ndo,
               case GMPLS_PSC2:
               case GMPLS_PSC3:
               case GMPLS_PSC4:
-                ND_TCHECK2(*tptr, 6);
+                if (subl < 6)
+                    break;
                 bw.i = EXTRACT_32BITS(tptr);
                 ND_PRINT((ndo, "%s  Min LSP Bandwidth: %.3f Mbps", ident, bw.f * 8 / 1000000));
                 ND_PRINT((ndo, "%s  Interface MTU: %u", ident, EXTRACT_16BITS(tptr + 4)));
                 break;
               case GMPLS_TSC:
-                ND_TCHECK2(*tptr, 8);
+                if (subl < 8)
+                    break;
                 bw.i = EXTRACT_32BITS(tptr);
                 ND_PRINT((ndo, "%s  Min LSP Bandwidth: %.3f Mbps", ident, bw.f * 8 / 1000000));
                 ND_PRINT((ndo, "%s  Indication %s", ident,