From 411118a594dbcee68cd6adf5f6bd1b9db0ff9190 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 16 Oct 2006 22:54:38 +0000 Subject: [PATCH] 2096. [bug] libbind: handle applications that fail to detect res_init() failures better. --- CHANGES | 3 +++ lib/bind/resolv/res_send.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 394c83c381..73668ccea8 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 b1219a3d8b..87aab5a51d 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); }