From 6d2c0df71d1ecc0ed52f0631c6aee8d7f992cc43 Mon Sep 17 00:00:00 2001 From: Olaf Kirch Date: Sun, 11 Mar 2007 07:42:33 +0100 Subject: [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 Signed-off-by: David S. Miller Signed-off-by: Adrian Bunk --- net/ipv6/ipv6_sockglue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 03ecbfeab849..4c2a9a2e9053 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -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; -- cgit v1.2.3