summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-09-30 08:07:16 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-09-30 08:07:16 +0000
commit84fa12c8853a45ee0f043326f0f6689d470fb1bd (patch)
treeacb1c6ed815c77d0d3586a5e63f6c7f13d54e8fe
parent296b35fe9b796a50323f19c84ff0075e4702004b (diff)
downloadgnurl-84fa12c8853a45ee0f043326f0f6689d470fb1bd.tar.gz
gnurl-84fa12c8853a45ee0f043326f0f6689d470fb1bd.tar.bz2
gnurl-84fa12c8853a45ee0f043326f0f6689d470fb1bd.zip
Cris Bailiff found this flaw, gethostbyname_r() on linux returns 0 even
when it can't lookup the name (at least in some cases) and thus we need to make an extra check to detect failures.
-rw-r--r--lib/hostip.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index 5876396b7..42cac0501 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -605,6 +605,8 @@ Curl_addrinfo *Curl_getaddrinfo(struct SessionHandle *data,
&h_errnop))==ERANGE) {
step_size+=200;
}
+ if(!h) /* failure */
+ res=1;
#ifdef MALLOCDEBUG
infof(data, "gethostbyname_r() uses %d bytes\n", step_size);