[IPV6]: Fix for ipv6_setsockopt NULL dereference
I came across this bug in http://bugzilla.kernel.org/show_bug.cgi?id=8155 Signed-off-by: Olaf Kirch <olaf.kirch@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Adrian Bunk <bunk@stusta.de>
This commit is contained in:
@@ -308,7 +308,7 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname,
|
||||
}
|
||||
|
||||
/* routing header option needs extra check */
|
||||
if (optname == IPV6_RTHDR && opt->srcrt) {
|
||||
if (optname == IPV6_RTHDR && opt && opt->srcrt) {
|
||||
struct ipv6_rt_hdr *rthdr = opt->srcrt;
|
||||
if (rthdr->type)
|
||||
goto sticky_done;
|
||||
|
||||
Reference in New Issue
Block a user