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://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=dfee0a725bb027b749ffdd318eb48b91d564b266 [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 --- Adjusted to apply to Debian's 2.6.18 by dann frazier --- source/net/ipv6/ipv6_sockglue.c.orig 2007-03-22 09:58:17.000000000 -0600 +++ source/net/ipv6/ipv6_sockglue.c 2007-03-22 09:59:22.000000000 -0600 @@ -408,7 +408,7 @@ } /* 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;