summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/icmp6.c
diff options
context:
space:
mode:
authorgnn <gnn@FreeBSD.org>2005-05-15 02:28:30 +0000
committergnn <gnn@FreeBSD.org>2005-05-15 02:28:30 +0000
commitc853caca3e5fddae2276561f74356a4ec54783e0 (patch)
tree0bf3963d121c2edbe8546d00ad1b734f627e3ec4 /sys/netinet6/icmp6.c
parent73f56fbd1534693ebd2437de00078408de2b3851 (diff)
downloadFreeBSD-src-c853caca3e5fddae2276561f74356a4ec54783e0.zip
FreeBSD-src-c853caca3e5fddae2276561f74356a4ec54783e0.tar.gz
Fixes for various nits found by the Coverity tool.
In particular 2 missed return values and an inappropriate bcopy from a possibly NULL pointer. Reviewed by: jake Approved by: rwatson MFC after: 1 week
Diffstat (limited to 'sys/netinet6/icmp6.c')
-rw-r--r--sys/netinet6/icmp6.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 5ab4203..3f3cbd6 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -2092,13 +2092,16 @@ icmp6_reflect(m, off)
sa6_src.sin6_len = sizeof(sa6_src);
sa6_src.sin6_addr = ip6->ip6_dst;
in6_recoverscope(&sa6_src, &ip6->ip6_dst, m->m_pkthdr.rcvif);
- in6_embedscope(&ip6->ip6_dst, &sa6_src, NULL, NULL);
+ if (in6_embedscope(&ip6->ip6_dst, &sa6_src, NULL, NULL))
+ goto bad;
+
bzero(&sa6_dst, sizeof(sa6_dst));
sa6_dst.sin6_family = AF_INET6;
sa6_dst.sin6_len = sizeof(sa6_dst);
sa6_dst.sin6_addr = t;
in6_recoverscope(&sa6_dst, &t, m->m_pkthdr.rcvif);
- in6_embedscope(&t, &sa6_dst, NULL, NULL);
+ if (in6_embedscope(&t, &sa6_dst, NULL, NULL))
+ goto bad;
#ifdef COMPAT_RFC1885
/*
OpenPOWER on IntegriCloud