From mboxrd@z Thu Jan 1 00:00:00 1970 From: hjl@varesearch.com (H.J. Lu) To: libc-hacker@sourceware.cygnus.com (GNU C Library) Subject: nscd and getxxxxx_r () are all screwed up. Date: Mon, 09 Aug 1999 18:48:00 -0000 Message-id: <19990810014844.037B03FC1@varesearch.com> X-SW-Source: 1999-08/msg00022.html 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)