From: Francois-Xavier Le Bail Date: Fri, 11 Sep 2020 08:05:43 +0000 (+0200) Subject: Revert partially the commit 21b1273 X-Git-Tag: tcpdump-4.99-bp~232 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/5ef0bcb5edd748de9d9af13c40da0395dfdd94e8 Revert partially the commit 21b1273 This change add back 4 ND_TCHECK_n() because their removal may be unsafe. (via Denis comment) --- diff --git a/print-bgp.c b/print-bgp.c index f4d17491..ab3e2835 100644 --- a/print-bgp.c +++ b/print-bgp.c @@ -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)); diff --git a/print-juniper.c b/print-juniper.c index 164973c6..1560cee5 100644 --- a/print-juniper.c +++ b/print-juniper.c @@ -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); diff --git a/print-openflow-1.0.c b/print-openflow-1.0.c index 7fb0f405..6c224b73 100644 --- a/print-openflow-1.0.c +++ b/print-openflow-1.0.c @@ -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