summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Kirch <olaf.kirch@oracle.com>2007-03-11 07:42:33 +0100
committerAdrian Bunk <bunk@stusta.de>2007-03-11 07:42:33 +0100
commit6d2c0df71d1ecc0ed52f0631c6aee8d7f992cc43 (patch)
tree377b0cb376dc15f6c5cea3c4fc1da96a2aa51750
parentdfe67217aea3eb4ecbab736903f6ecee3458b8a8 (diff)
downloadkernel-common-6d2c0df71d1ecc0ed52f0631c6aee8d7f992cc43.tar.gz
kernel-common-6d2c0df71d1ecc0ed52f0631c6aee8d7f992cc43.tar.bz2
kernel-common-6d2c0df71d1ecc0ed52f0631c6aee8d7f992cc43.zip
[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>
-rw-r--r--net/ipv6/ipv6_sockglue.c2
1 files changed, 1 insertions, 1 deletions
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;