summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2001-06-24 14:59:34 +0000
committerume <ume@FreeBSD.org>2001-06-24 14:59:34 +0000
commit606d517ceaaca748519b0832af0b28162169655d (patch)
tree05f65080e7c8f32c7d31ea52945bcd94c24d14f3 /sys/netinet6
parentf3ce537ea7335f27585c0cd7c2f7e56f219dd1c9 (diff)
downloadFreeBSD-src-606d517ceaaca748519b0832af0b28162169655d.zip
FreeBSD-src-606d517ceaaca748519b0832af0b28162169655d.tar.gz
on icmp6 node information query (FQDN), do not return hostnames with
two dots (like "foo..bar"). 0-length labels are not distinguishable with multiple name replies. Obtained from: KAME MFC after: 10 days
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/icmp6.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 4ea9a3a..2b2f6ea 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1539,8 +1539,12 @@ ni6_nametodns(name, namelen, old)
/* result does not fit into mbuf */
if (cp + i + 1 >= ep)
goto fail;
- /* DNS label length restriction, RFC1035 page 8 */
- if (i >= 64)
+ /*
+ * DNS label length restriction, RFC1035 page 8.
+ * "i == 0" case is included here to avoid returning
+ * 0-length label on "foo..bar".
+ */
+ if (i <= 0 || i >= 64)
goto fail;
*cp++ = i;
bcopy(p, cp, i);
OpenPOWER on IntegriCloud