summaryrefslogtreecommitdiff
path: root/print-snmp.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-09-05 19:40:32 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-09-06 20:22:29 +0200
commitabc8c2d61c65757011d9d32abb01cd1e51232f3a (patch)
treea4c9890086314bffc5236c815c773975e471cc4a /print-snmp.c
parent54b5db3dde658894be730b15480f9b6e27b717a0 (diff)
downloadtcpdump-abc8c2d61c65757011d9d32abb01cd1e51232f3a.tar.gz
Remove many (762) now redundant ND_TCHECK_n() calls
ND_TCHECK_n(e), n in { 1, 2, 3, 4, 8 }. They are redundant because they are followed by a GET_.*_n(e) call, same n, same e, which do the bounds check. Remove unused 'trunc' labels and most associated codes. Update the outputs of some tests accordingly.
Diffstat (limited to 'print-snmp.c')
-rw-r--r--print-snmp.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/print-snmp.c b/print-snmp.c
index 03e5c3b4..24acaf7f 100644
--- a/print-snmp.c
+++ b/print-snmp.c
@@ -430,7 +430,6 @@ asn1_parse(netdissect_options *ndo,
ND_PRINT("[nothing to parse]");
return -1;
}
- ND_TCHECK_1(p);
/*
* it would be nice to use a bit field, but you can't depend on them.
@@ -465,7 +464,6 @@ asn1_parse(netdissect_options *ndo,
* that won't fit in 32 bits.
*/
id = 0;
- ND_TCHECK_1(p);
while (GET_U_1(p) & ASN_BIT8) {
if (len < 1) {
ND_PRINT("[Xtagfield?]");
@@ -481,7 +479,6 @@ asn1_parse(netdissect_options *ndo,
ND_PRINT("[Xtagfield?]");
return -1;
}
- ND_TCHECK_1(p);
elem->id = id = (id << 7) | GET_U_1(p);
--len;
++hdr;
@@ -491,7 +488,6 @@ asn1_parse(netdissect_options *ndo,
ND_PRINT("[no asnlen]");
return -1;
}
- ND_TCHECK_1(p);
elem->asnlen = GET_U_1(p);
p++; len--; hdr++;
if (elem->asnlen & ASN_BIT8) {
@@ -771,7 +767,6 @@ asn1_print(netdissect_options *ndo,
}
for (; i != 0; p++, i--) {
- ND_TCHECK_1(p);
o = (o << ASN_SHIFT7) + (GET_U_1(p) & ~ASN_BIT8);
if (GET_U_1(p) & ASN_LONGLEN)
continue;
@@ -924,7 +919,6 @@ smi_decode_oid(netdissect_options *ndo,
unsigned int firstval;
for (*oidlen = 0; i != 0; p++, i--) {
- ND_TCHECK_1(p);
o = (o << ASN_SHIFT7) + (GET_U_1(p) & ~ASN_BIT8);
if (GET_U_1(p) & ASN_LONGLEN)
continue;
@@ -948,10 +942,6 @@ smi_decode_oid(netdissect_options *ndo,
o = 0;
}
return 0;
-
-trunc:
- nd_print_trunc(ndo);
- return -1;
}
static int smi_check_type(SmiBasetype basetype, int be)