Skip to content

Commit

Permalink
[IPV6]: Fix for ipv6_setsockopt NULL dereference
Browse files Browse the repository at this point in the history
I came across this bug in http://bugzilla.kernel.org/show_bug.cgi?id=8155

Signed-off-by: Olaf Kirch <olaf.kirch@oracle.com>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Olaf Kirch authored and David S. Miller committed Mar 9, 2007
1 parent aabb601 commit dfee0a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/ipv6_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,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:
Expand Down

0 comments on commit dfee0a7

Please sign in to comment.