]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-rt6.c
CVE-2017-13725/IPv6 R.H.: Check for the existence of all fields before fetching them.
[tcpdump] / print-rt6.c
index 35dbed981b0e448497f5f3ff272a99319094820b..0395791d763864ea34f0b91c9dbc2e3ebdcedb5b 100644 (file)
@@ -45,13 +45,13 @@ rt6_print(netdissect_options *ndo, register const u_char *bp, const u_char *bp2
        register const struct in6_addr *addr;
 
        dp = (const struct ip6_rthdr *)bp;
-       len = dp->ip6r_len;
 
        /* 'ep' points to the end of available data. */
        ep = ndo->ndo_snapend;
 
        ND_TCHECK(dp->ip6r_segleft);
 
+       len = dp->ip6r_len;
        ND_PRINT((ndo, "srcrt (len=%d", dp->ip6r_len)); /*)*/
        ND_PRINT((ndo, ", type=%d", dp->ip6r_type));
        ND_PRINT((ndo, ", segleft=%d", dp->ip6r_segleft));