summaryrefslogtreecommitdiff
path: root/lib/libc/net/name6.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2002-06-26 06:04:46 +0000
committerWarner Losh <imp@FreeBSD.org>2002-06-26 06:04:46 +0000
commit4cf0747073a506c6fdde123dad434c06bbaef54c (patch)
tree792798242de1764381a796b9f104b23f568ea708 /lib/libc/net/name6.c
parentf587582238acf789c98bb6e80d510ff077f93024 (diff)
Notes
Diffstat (limited to 'lib/libc/net/name6.c')
-rw-r--r--lib/libc/net/name6.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/net/name6.c b/lib/libc/net/name6.c
index 4a6d518cac63..51edfd50fe83 100644
--- a/lib/libc/net/name6.c
+++ b/lib/libc/net/name6.c
@@ -997,7 +997,7 @@ getanswer(answer, anslen, qname, qtype, template, errp)
const u_char *cp;
int n;
const u_char *eom, *erdata;
- char *bp, **ap, **hap;
+ char *bp, **ap, **hap, *obp;
int type, class, buflen, ancount, qdcount;
int haveanswer, had_error;
char tbuf[MAXDNAME];
@@ -1211,7 +1211,9 @@ getanswer(answer, anslen, qname, qtype, template, errp)
bp += nn;
buflen -= nn;
}
+ obp = bp; /* ALIGN rounds up */
bp = (char *)ALIGN(bp);
+ buflen -= (bp - obp);
DNS_FATAL(bp + n < &hostbuf[sizeof hostbuf]);
DNS_ASSERT(hap < &h_addr_ptrs[MAXADDRS-1]);