mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-23 18:14:29 +08:00
CVE-2017-13725/IPv6 R.H.: Check for the existence of all fields before fetching them.
Don't fetch the length field from the header until after we've checked for the existence of a field at or after that field. (Found by code inspection, not by a capture.)
This commit is contained in:
parent
66df248b49
commit
3c4d7c0ee3
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user