From da162ff554fed0189ed4d55c19e1b3c001f7673b Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Thu, 30 Jan 1997 05:56:07 +0000 Subject: careful about MAXADDRS, abrown@eecs.harvard.edu --- lib/libc/net/gethostnamadr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/libc') 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) -- cgit v1.2.3