]> The Tcpdump Group git mirrors - tcpdump/commitdiff
EIGRP: Add two missing bounds checks
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 28 Apr 2019 12:38:52 +0000 (14:38 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 28 Apr 2019 12:38:52 +0000 (14:38 +0200)
print-eigrp.c

index 5c9755520935172f7191d558aa6c6ffef2fc0ad3..ea48a0ad8d56ebe3ed35441994734d3137314681 100644 (file)
@@ -357,6 +357,7 @@ eigrp_print(netdissect_options *ndo, const u_char *pptr, u_int len)
             }
             byte_length = (bit_length + 7) / 8; /* variable length encoding */
             memset(prefix, 0, 4);
+            ND_TCHECK_LEN(tlv_ptr.eigrp_tlv_ip_int->destination, byte_length);
             memcpy(prefix, tlv_ptr.eigrp_tlv_ip_int->destination, byte_length);
 
             ND_PRINT("\n\t    IPv4 prefix: %15s/%u, nexthop: ",
@@ -392,6 +393,7 @@ eigrp_print(netdissect_options *ndo, const u_char *pptr, u_int len)
             }
             byte_length = (bit_length + 7) / 8; /* variable length encoding */
             memset(prefix, 0, 4);
+            ND_TCHECK_LEN(tlv_ptr.eigrp_tlv_ip_ext->destination, byte_length);
             memcpy(prefix, tlv_ptr.eigrp_tlv_ip_ext->destination, byte_length);
 
             ND_PRINT("\n\t    IPv4 prefix: %15s/%u, nexthop: ",