public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* nscd and getxxxxx_r () are all screwed up.
@ 1999-08-09 18:48 H.J. Lu
  1999-08-09 22:30 ` Ulrich Drepper
  0 siblings, 1 reply; 3+ messages in thread
From: H.J. Lu @ 1999-08-09 18:48 UTC (permalink / raw)
  To: GNU C Library

nscd and getxxxxx_r () in glibc 2.1.2 are all screwed up. hstcache.c
in nscd has:

  while (__gethostbyname2_r (key, AF_INET, &resultbuf, buffer, buflen, 
                             &hst, &h_errno) != 0
         && h_errno == NETDB_INTERNAL
         && errno == ERANGE) 
    {
      errno = 0;
      buflen += 256; 
      buffer = alloca (buflen);
    }

However, when getanswer_r in resolve/nss_dns/dns-host.c runs out of
buffer around line 619, it never bothers to set errno nor h_errno. It
does that with


	if (result->h_name == NULL)
	  {
	    ....
	  }


It is incorrect since getanswer_r can run out of memory after 
result->h_name is set. It looks like a mess to me. I hope someone
will fix it soon.


-- 
H.J. Lu (hjl@gnu.org)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-08-10  8:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-09 18:48 nscd and getxxxxx_r () are all screwed up H.J. Lu
1999-08-09 22:30 ` Ulrich Drepper
1999-08-10  8:02   ` H.J. Lu

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).