public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix getnameinfo for many PTR record queries
@ 2008-02-25 16:51 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2008-02-25 16:51 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

_nss_dns_gethostbyname* trusts getanswer_r to set *errnop and *h_errnop
right (and from what I can see, at least for the too small buffer case
it does the right thing), but _nss_dns_gethostbyaddr2_r will overwrite
anything getanswer_r put into those variables with whatever h_errno/errno
contain (which probably isn't related to the current error).
I've tested it fixes the 258 PTR records getnameinfo query in BZ, though
haven't done much testing beyond that.

2008-02-25  Jakub Jelinek  <jakub@redhat.com>

	[BZ #5790]
	* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyaddr2_r): Don't
	overwrite *h_errnop/*errnop values from getanswer_r in case of
	failure.

--- libc/resolv/nss_dns/dns-host.c	30 Oct 2007 00:57:56 -0000	1.46
+++ libc/resolv/nss_dns/dns-host.c	25 Feb 2008 16:04:58 -0000
@@ -386,11 +386,7 @@ _nss_dns_gethostbyaddr2_r (const void *a
   if (host_buffer.buf != orig_host_buffer)
     free (host_buffer.buf);
   if (status != NSS_STATUS_SUCCESS)
-    {
-      *h_errnop = h_errno;
-      *errnop = errno;
-      return status;
-    }
+    return status;
 
 #ifdef SUNSECURITY
   This is not implemented because it is not possible to use the current

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-25 16:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-25 16:51 [PATCH] Fix getnameinfo for many PTR record queries Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).