[PATCH] tcp: Explicit bound check on options length field
For some reason, Coverity only reports this (harmless) warning after
David's series unifying IPv4 and IPv6 sockets for TCP: an untrusted
loop bound (CWE-606) in tcp_opt_get(), coming from the fact that we
use indeed the value of a TCP header field as loop bound.
Note, though, that the loop already checks we're not exceeding the
length of the option field, and this field is used as 8-bit unsigned
value, so we can't really look for options past the end of the
header.
In any case, make Coverity happy with an explicit check.
Signed-off-by: Stefano Brivio
participants (1)
-
Stefano Brivio