From: Mark Andrews Date: Mon, 16 Oct 2006 22:54:38 +0000 (+0000) Subject: 2096. [bug] libbind: handle applications that fail to detect X-Git-Tag: v9.5.0a1~116 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=411118a594dbcee68cd6adf5f6bd1b9db0ff9190;p=thirdparty%2Fbind9.git 2096. [bug] libbind: handle applications that fail to detect res_init() failures better. --- diff --git a/CHANGES b/CHANGES index 394c83c3811..73668ccea8d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2096. [bug] libbind: handle applications that fail to detect + res_init() failures better. + 2095. [port] libbind: alway prototype inet_cidr_ntop_ipv6() and net_cidr_ntop_ipv6(). [RT #16388] diff --git a/lib/bind/resolv/res_send.c b/lib/bind/resolv/res_send.c index b1219a3d8b0..87aab5a51d9 100644 --- a/lib/bind/resolv/res_send.c +++ b/lib/bind/resolv/res_send.c @@ -70,7 +70,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_send.c,v 1.16 2006/03/08 04:06:12 marka Exp $"; +static const char rcsid[] = "$Id: res_send.c,v 1.17 2006/10/16 22:54:38 marka Exp $"; #endif /* LIBC_SCCS and not lint */ /*! \file @@ -300,7 +300,8 @@ res_nsend(res_state statp, highestFD = sysconf(_SC_OPEN_MAX) - 1; #endif - if (statp->nscount == 0) { + /* No name servers or res_init() failure */ + if (statp->nscount == 0 || EXT(statp).ext == NULL) { errno = ESRCH; return (-1); }