summaryrefslogtreecommitdiff
path: root/lib/libc/net/gethostnamadr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/net/gethostnamadr.c')
-rw-r--r--lib/libc/net/gethostnamadr.c4
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)