]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Fix another NULL pointer deref in ipv6_sockglue.c
authorOlaf Kirch <olaf.kirch@oracle.com>
Sat, 10 Mar 2007 07:03:53 +0000 (23:03 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 23 Mar 2007 19:49:18 +0000 (12:49 -0700)
[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: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv6/ipv6_sockglue.c

index 23db88eb437bf37aba649c13b7f6c160cbe243ba..b20726fa0f8f387b50ab746595eaa39b79b8990f 100644 (file)
@@ -414,7 +414,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: