*/
#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>
*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)