summaryrefslogtreecommitdiff
path: root/print-radius.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-radius.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-radius.c')
-rw-r--r--print-radius.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/print-radius.c b/print-radius.c
index 8c33438f..5c27710a 100644
--- a/print-radius.c
+++ b/print-radius.c
@@ -845,7 +845,6 @@ print_vendor_attr(netdissect_options *ndo,
if (length < 4)
goto trunc;
- ND_TCHECK_4(data);
vendor_id = GET_BE_U_4(data);
data+=4;
length-=4;
@@ -1302,17 +1301,11 @@ print_attr_time(netdissect_options *ndo,
return;
}
- ND_TCHECK_4(data);
-
attr_time = GET_BE_U_4(data);
strlcpy(string, ctime(&attr_time), sizeof(string));
/* Get rid of the newline */
string[24] = '\0';
ND_PRINT("%.24s", string);
- return;
-
- trunc:
- nd_print_trunc(ndo);
}
static void
@@ -1386,13 +1379,11 @@ print_attr_strange(netdissect_options *ndo,
ND_PRINT("ERROR: length %u != 14", length);
return;
}
- ND_TCHECK_1(data);
if (GET_U_1(data))
ND_PRINT("User can change password");
else
ND_PRINT("User cannot change password");
data++;
- ND_TCHECK_1(data);
ND_PRINT(", Min password length: %u", GET_U_1(data));
data++;
ND_PRINT(", created at: ");
@@ -1426,7 +1417,6 @@ print_attr_strange(netdissect_options *ndo,
ND_PRINT("Error: length %u != 4", length);
return;
}
- ND_TCHECK_4(data);
error_cause_value = GET_BE_U_4(data);
ND_PRINT("Error cause %u: %s", error_cause_value, tok2str(errorcausetype, "Error-Cause %u not known", error_cause_value));