Skip to contentSkip to conversation

Fix another NULL pointer deref in ipv6_sockglue.c

PATCH New Greg KH 1 participant 1 message Mar 19, 2007

Subsystems (2)
lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/31 Fix another NULL pointer deref in ipv6_sockglue.c

-stable review patch. If anyone has any objections, please let us know.

------------------

From: Olaf Kirch <[email protected]>

[IPV6]: Fix for ipv6_setsockopt NULL dereference

I came across this bug in http://bugzilla.kernel.org/show_bug.cgi?id=8155

---
 net/ipv6/ipv6_sockglue.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ipv6_sockglue.c +1 -1
@@ -414,7 +414,7 @@ static int do_ipv6_setsockopt(struct soc
 		}
 
 		/* 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: