diff options
author | pst <pst@FreeBSD.org> | 1996-10-01 03:45:06 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1996-10-01 03:45:06 +0000 |
commit | 2e60f50f68a3916d8a5a1fe3b787637180aec93a (patch) | |
tree | 1502d2233441533afdcc0577290e7296525cd56c /lib/libc/net/gethostbydns.c | |
parent | 69ea9ac338ad4da7498b774d1854c578d1f2e577 (diff) | |
download | FreeBSD-src-2e60f50f68a3916d8a5a1fe3b787637180aec93a.zip FreeBSD-src-2e60f50f68a3916d8a5a1fe3b787637180aec93a.tar.gz |
Skip results that have unexpected lengths
Diffstat (limited to 'lib/libc/net/gethostbydns.c')
-rw-r--r-- | lib/libc/net/gethostbydns.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c index 8fdbd9a..1d48bdc 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 <sys/types.h> @@ -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; |