From: deraadt Date: Thu, 30 Jan 1997 05:56:06 +0000 (+0000) Subject: careful about MAXADDRS, abrown@eecs.harvard.edu X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9b66f70810644075cedea1badf4a3bfb978631ee;p=openbsd careful about MAXADDRS, abrown@eecs.harvard.edu --- 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 @@ -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)