From beddb20c7a1f1837e061f40fbd020dc2a09ed0a3 Mon Sep 17 00:00:00 2001 From: Paul Traina Date: Tue, 1 Oct 1996 03:45:06 +0000 Subject: [PATCH] Skip results that have unexpected lengths --- lib/libc/net/gethostbydns.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c index 8fdbd9afcad..1d48bdc001c 100644 --- a/lib/libc/net/gethostbydns.c +++ b/lib/libc/net/gethostbydns.c @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: gethostbydns.c,v 1.9 1996/07/12 18:54:33 jkh Exp $"; +static char rcsid[] = "$Id: gethostbydns.c,v 1.10 1996/08/29 20:07:50 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -321,12 +321,11 @@ gethostanswer(answer, anslen, qname, qtype) cp += n; continue; /* XXX - had_error++ ? */ } - if (haveanswer) { - if (n != host.h_length) { - cp += n; - continue; - } - } else { + if (n != host.h_length) { + cp += n; + continue; + } + if (!haveanswer) { register int nn; host.h_name = bp;