]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Remove 3 now redundant ND_TCHECK_LEN(e, sizeof(short)) calls
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 30 Sep 2020 08:15:03 +0000 (10:15 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 30 Sep 2020 08:29:43 +0000 (10:29 +0200)
They are redundant because they are identical to ND_TCHECK_2(e), followed
by a GET_BE_U_2(e) or a GET_LE_U_2(e), same e, which do the bounds check.

print-decnet.c
print-krb.c

index 301fdd9d1a16c2b95d577b3f21f467f868c9a743..0ad0331898c3538fb64d6c68085cfafcca4e148d 100644 (file)
@@ -494,7 +494,6 @@ decnet_print(netdissect_options *ndo,
                return;
        }
 
-       ND_TCHECK_LEN(ap, sizeof(short));
        pktlen = GET_LE_U_2(ap);
        if (pktlen < sizeof(struct shorthdr)) {
                nd_print_trunc(ndo);
index 80b6cab625da3304bc3b2027ae182e2563d97a6a..b4c0fadf7c576f21a39929d72567c02469ebe3ae 100644 (file)
@@ -200,7 +200,6 @@ krb4_print(netdissect_options *ndo,
                if ((cp = krb4_print_hdr(ndo, cp)) == NULL)
                        return;
                cp += 10;       /* timestamp + n + exp + kvno */
-               ND_TCHECK_LEN(cp, sizeof(short));
                len = KTOHSP(kp, cp);
                ND_PRINT(" (%u)", len);
                break;
@@ -209,7 +208,6 @@ krb4_print(netdissect_options *ndo,
                if ((cp = krb4_print_hdr(ndo, cp)) == NULL)
                        return;
                cp += 4;          /* timestamp */
-               ND_TCHECK_LEN(cp, sizeof(short));
                ND_PRINT(" %s ", tok2str(kerr2str, NULL, KTOHSP(kp, cp)));
                cp += 4;
                PRINT;