From: Olaf Kirch Date: Fri, 9 Mar 2007 21:55:38 +0000 (-0800) Subject: [IPV6]: Fix for ipv6_setsockopt NULL dereference X-Git-Tag: v2.6.21-rc4~50^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=dfee0a725bb027b749ffdd318eb48b91d564b266;p=linux-2.6-omap-h63xx.git [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 Acked-by: YOSHIFUJI Hideaki Signed-off-by: David S. Miller --- diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 4e0561a082d..b82333b9228 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -413,7 +413,7 @@ static int do_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; switch (rthdr->type) { case IPV6_SRCRT_TYPE_0: