]> The Tcpdump Group git mirrors - tcpdump/commitdiff
OSPFv3: Add/remove some bounds checks
authorFrancois-Xavier Le Bail <[email protected]>
Tue, 2 Apr 2019 13:28:54 +0000 (15:28 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 2 Apr 2019 13:38:43 +0000 (15:38 +0200)
Remove two bounds checks now useless with GET_ macros uses.
The check on 'lshp->ls_router' is needed before ipaddr_string() call.

print-ospf6.c

index c734b4d20ebe264608591b14ec93e6b6bc426f72..cec67e1d91f9a2b69dcfc1605a5b4118f9405115 100644 (file)
@@ -388,8 +388,7 @@ ospf6_print_lshdr(netdissect_options *ndo,
 {
        if ((const u_char *)(lshp + 1) > dataend)
                goto trunc;
 {
        if ((const u_char *)(lshp + 1) > dataend)
                goto trunc;
-       ND_TCHECK_2(lshp->ls_type);
-       ND_TCHECK_4(lshp->ls_seq);
+       ND_TCHECK_4(lshp->ls_router);
 
        ND_PRINT("\n\t  Advertising Router %s, seq 0x%08x, age %us, length %u",
                ipaddr_string(ndo, lshp->ls_router),
 
        ND_PRINT("\n\t  Advertising Router %s, seq 0x%08x, age %us, length %u",
                ipaddr_string(ndo, lshp->ls_router),