]> The Tcpdump Group git mirrors - tcpdump/commitdiff
PGM: Remove 3 now redundant ND_TCHECK_LEN(e, sizeof(uint32_t)) calls
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 30 Sep 2020 08:48:04 +0000 (10:48 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 30 Sep 2020 08:49:47 +0000 (10:49 +0200)
They are redundant because they are identical to ND_TCHECK_4(e), followed
by a GET_BE_U_4(e), same e, which do the bounds check.

print-pgm.c

index 7c47b12b06674a084cb867088d7d59c5e824d125..ccb0b46afef9982c4e1851063baa355f101e8b05 100644 (file)
@@ -276,15 +276,12 @@ pgm_print(netdissect_options *ndo,
                break;
            }
 
-           ND_TCHECK_LEN(bp, sizeof(uint32_t));
            ivl = GET_BE_U_4(bp);
            bp += sizeof(uint32_t);
 
-           ND_TCHECK_LEN(bp, sizeof(uint32_t));
            rnd = GET_BE_U_4(bp);
            bp += sizeof(uint32_t);
 
-           ND_TCHECK_LEN(bp, sizeof(uint32_t));
            mask = GET_BE_U_4(bp);
            bp += sizeof(uint32_t);