summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-09-11 10:05:43 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-09-11 10:12:43 +0200
commit5ef0bcb5edd748de9d9af13c40da0395dfdd94e8 (patch)
tree142c0d3deffc56dca3f1af2b33e19687735d26d8
parenta520beed7396c2edf80eae9c4533b78a88721965 (diff)
downloadtcpdump-5ef0bcb5edd748de9d9af13c40da0395dfdd94e8.tar.gz
Revert partially the commit 21b1273
This change add back 4 ND_TCHECK_n() because their removal may be unsafe. (via Denis comment)
-rw-r--r--print-bgp.c1
-rw-r--r--print-juniper.c1
-rw-r--r--print-openflow-1.0.c2
3 files changed, 4 insertions, 0 deletions
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