]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Revert partially the commit 21b1273
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 11 Sep 2020 08:05:43 +0000 (10:05 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 11 Sep 2020 08:12:43 +0000 (10:12 +0200)
This change add back 4 ND_TCHECK_n() because their removal may be unsafe.
(via Denis comment)

print-bgp.c
print-juniper.c
print-openflow-1.0.c

index f4d174915430460da9cfe8bb08b9cad245beef8a..ab3e2835539c4bde00573ee4cf293b6034747c41 100644 (file)
@@ -1326,6 +1326,7 @@ decode_labeled_vpn_l2(netdissect_options *ndo,
                         }
                         return plen + 2;
                     }
+                    ND_TCHECK_1(pptr);
                     if (buflen != 0) {
                         stringlen=snprintf(buf,buflen, "%02x",
                                               GET_U_1(pptr));
index 164973c6337247bd51acc85efb5f0a8d7e37da00..1560cee554dc7db0cc012b5075364779eb87f7c2 100644 (file)
@@ -1534,6 +1534,7 @@ juniper_parse_header(netdissect_options *ndo,
 #endif
 #ifdef DLT_JUNIPER_ATM2
     case DLT_JUNIPER_ATM2:
+        ND_TCHECK_4(p);
         /* ATM cell relay control word present ? */
         if (l2info->cookie[7] & ATM2_PKT_TYPE_MASK) {
             control_word = GET_BE_U_4(p);
index 7fb0f4056c5d08ed19f01aa17439657e51bc0fdd..6c224b73aaf60eb3670672a6be1dbd4a0d314219 100644 (file)
@@ -1387,6 +1387,7 @@ of10_match_print(netdissect_options *ndo,
                ND_PRINT("%smatch nw_dst %s/%u", pfx, GET_IPADDR_STRING(cp), 32 - nw_bits);
        cp += 4;
        /* tp_src */
+       ND_TCHECK_2(cp);
        if (! (wildcards & OFPFW_TP_SRC)) {
                field_name = ! (wildcards & OFPFW_DL_TYPE) && dl_type == ETHERTYPE_IP
                  && ! (wildcards & OFPFW_NW_PROTO) && nw_proto == IPPROTO_ICMP
@@ -1395,6 +1396,7 @@ of10_match_print(netdissect_options *ndo,
        }
        cp += 2;
        /* tp_dst */
+       ND_TCHECK_2(cp);
        if (! (wildcards & OFPFW_TP_DST)) {
                field_name = ! (wildcards & OFPFW_DL_TYPE) && dl_type == ETHERTYPE_IP
                  && ! (wildcards & OFPFW_NW_PROTO) && nw_proto == IPPROTO_ICMP