Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mptcp: Avoid NULL dereference in mptcp_getsockopt_subflow_addrs()
Coverity complains of a possible NULL dereference in mptcp_getsockopt_subflow_addrs(): 861 } else if (sk->sk_family == AF_INET6) { 3. returned_null: inet6_sk returns NULL. [show details] 4. var_assigned: Assigning: np = NULL return value from inet6_sk. 862 const struct ipv6_pinfo *np = inet6_sk(sk); Fix this by checking for NULL. Closes: #231 Fixes: c11c590 ("mptcp: add MPTCP_SUBFLOW_ADDRS getsockopt support") Cc: Florian Westphal <[email protected]> Signed-off-by: Tim Gardner <[email protected]> [mjm: Added WARN_ON_ONCE() to the unexpected case] Signed-off-by: Mat Martineau <[email protected]>
- Loading branch information