diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-01-30 05:56:07 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-01-30 05:56:07 +0000 |
commit | da162ff554fed0189ed4d55c19e1b3c001f7673b (patch) | |
tree | 4e427dc42067237ea25324c8197637213e61c73b /lib/libc/net | |
parent | f1b2c52d4f7fdc1ca8cafe071aa6c53fa58d9ffe (diff) |
careful about MAXADDRS, abrown@eecs.harvard.edu
Diffstat (limited to 'lib/libc/net')
-rw-r--r-- | lib/libc/net/gethostnamadr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c index 6d5124d3083..83e0225a656 100644 --- a/lib/libc/net/gethostnamadr.c +++ b/lib/libc/net/gethostnamadr.c @@ -52,7 +52,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.12 1996/09/28 13:26:34 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.13 1997/01/30 05:56:06 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -195,6 +195,8 @@ getanswer(answer, anslen, iquery) *hap = NULL; host.h_addr_list = h_addr_ptrs; haveanswer = 0; + if (ancount > MAXADDRS) + ancount = MAXADDRS; while (--ancount >= 0 && cp < eom) { if ((n = dn_expand((u_char *)answer->buf, (u_char *)eom, (u_char *)cp, bp, buflen)) < 0) |