ext_is_len = isis_print_ext_is_reach(ndo, tptr, "\n\t ", tlv_type, tlen);
if (ext_is_len == 0) /* did something go wrong ? */
goto trunc;
-
+ if (tlen < ext_is_len) {
+ ND_PRINT(" [remaining tlv length %u < %u]", tlen, ext_is_len);
+ nd_print_invalid(ndo);
+ break;
+ }
tlen-=ext_is_len;
tptr+=ext_is_len;
}
break;
case ISIS_TLV_IS_ALIAS_ID:
- while (tlen >= NODE_ID_LEN+1) { /* is it worth attempting a decode ? */
- ext_is_len = isis_print_ext_is_reach(ndo, tptr, "\n\t ", tlv_type, tlen);
- if (ext_is_len == 0) /* did something go wrong ? */
- goto trunc;
- tlen-=ext_is_len;
- tptr+=ext_is_len;
- }
- break;
+ while (tlen >= NODE_ID_LEN+1) { /* is it worth attempting a decode ? */
+ ext_is_len = isis_print_ext_is_reach(ndo, tptr, "\n\t ", tlv_type, tlen);
+ if (ext_is_len == 0) /* did something go wrong ? */
+ goto trunc;
+ if (tlen < ext_is_len) {
+ ND_PRINT(" [remaining tlv length %u < %u]", tlen, ext_is_len);
+ nd_print_invalid(ndo);
+ break;
+ }
+ tlen-=ext_is_len;
+ tptr+=ext_is_len;
+ }
+ break;
case ISIS_TLV_EXT_IS_REACH:
while (tlen >= NODE_ID_LEN+3+1) { /* is it worth attempting a decode ? */
ext_is_len = isis_print_ext_is_reach(ndo, tptr, "\n\t ", tlv_type, tlen);
if (ext_is_len == 0) /* did something go wrong ? */
goto trunc;
+ if (tlen < ext_is_len) {
+ ND_PRINT(" [remaining tlv length %u < %u]", tlen, ext_is_len);
+ nd_print_invalid(ndo);
+ break;
+ }
tlen-=ext_is_len;
tptr+=ext_is_len;
}
break;
case ISIS_TLV_EXTD_IP_REACH:
- while (tlen>0) {
+ while (tlen != 0) {
ext_ip_len = isis_print_extd_ip_reach(ndo, tptr, "\n\t ", AF_INET);
if (ext_ip_len == 0) /* did something go wrong ? */
goto trunc;
+ if (tlen < ext_ip_len) {
+ ND_PRINT(" [remaining tlv length %u < %u]", tlen, ext_ip_len);
+ nd_print_invalid(ndo);
+ break;
+ }
tptr+=ext_ip_len;
- tlen-=ext_ip_len;
- }
- break;
+ tlen-=ext_ip_len;
+ }
+ break;
case ISIS_TLV_MT_IP_REACH:
mt_len = isis_print_mtid(ndo, tptr, "\n\t ");
tptr+=mt_len;
tlen-=mt_len;
- while (tlen>0) {
+ while (tlen != 0) {
ext_ip_len = isis_print_extd_ip_reach(ndo, tptr, "\n\t ", AF_INET);
if (ext_ip_len == 0) /* did something go wrong ? */
goto trunc;
+ if (tlen < ext_ip_len) {
+ ND_PRINT(" [remaining tlv length %u < %u]", tlen, ext_ip_len);
+ nd_print_invalid(ndo);
+ break;
+ }
tptr+=ext_ip_len;
- tlen-=ext_ip_len;
- }
- break;
+ tlen-=ext_ip_len;
+ }
+ break;
case ISIS_TLV_IP6_REACH:
while (tlen != 0) {
tptr+=mt_len;
tlen-=mt_len;
- while (tlen>0) {
+ while (tlen != 0) {
ext_ip_len = isis_print_extd_ip_reach(ndo, tptr, "\n\t ", AF_INET6);
if (ext_ip_len == 0) /* did something go wrong ? */
goto trunc;
+ if (tlen < ext_ip_len) {
+ ND_PRINT(" [remaining tlv length %u < %u]", tlen, ext_ip_len);
+ nd_print_invalid(ndo);
+ break;
+ }
tptr+=ext_ip_len;
- tlen-=ext_ip_len;
- }
- break;
+ tlen-=ext_ip_len;
+ }
+ break;
case ISIS_TLV_IP6ADDR:
while (tlen>=sizeof(nd_ipv6)) {
IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.7d, no sub-TLVs present
- IS Neighbor: 0000.4a00.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.80, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0034.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, sub-TLVs present (35)
- unknown subTLV #2, length: 0
- unknown subTLV #0, length: 0
- unknown subTLV #0, length: 0
- unknown subTLV #0, length: 0
- unknown subTLV #0, length: 0
- unknown subTLV #0, length: 0
- unknown subTLV #0, length: 0
- unknown subTLV #0, length: 0
- unknown subTLV #0, length: 0
- unknown subTLV #0, length: 0
- unknown subTLV #105, length: 0
- unknown subTLV #0, length: 0
- unknown subTLV #0, length: 0
- unknown subTLV #0, length: 0
- unknown subTLV #0, length: 0
- unknown subTLV #2, length: 0
- unknown subTLV #0, length: 0
- Remaining data in subTLVs shorter than a subTLV header
- IS Neighbor: 0000.0000.0000.67, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.6500.8000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.4200.0000.00, sub-TLVs present (8)
- unknown subTLV #0, length: 0
- Remaining data in TLV shorter than a subTLV header
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 7901.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.32, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0800.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0089.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0025.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0025.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0025.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0800.00, no sub-TLVs present
- IS Neighbor: 2500.0000.0000.00, no sub-TLVs present
- IS Neighbor: 4a00.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
- IS Neighbor: 0000.0000.0000.00, no sub-TLVs present
+ IS Neighbor: 0000.0000.0000.7d, no sub-TLVs present [remaining tlv length 9 < 11] (invalid)
Padding TLV #8, length: 255
Padding TLV #8, length: 255
Padding TLV #8, length: 247