summaryrefslogtreecommitdiff
path: root/lib/curl_addrinfo.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-11-24 04:36:57 +0100
committerYang Tse <yangsita@gmail.com>2010-11-24 04:36:57 +0100
commit1d75d308169fe1c4ffd55c04a1a947530115b8cc (patch)
treeae7c5db31b894c85a2422fe9c024936d500a2db0 /lib/curl_addrinfo.c
parent6fe18add714d3d56d4ba24f2a2463fca125c0a1b (diff)
downloadcurl-1d75d308169fe1c4ffd55c04a1a947530115b8cc.tar.gz
Curl_getaddrinfo_ex: sanitize function results follow-up.
Diffstat (limited to 'lib/curl_addrinfo.c')
-rw-r--r--lib/curl_addrinfo.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c
index 7fb816f3a..6feccf2d0 100644
--- a/lib/curl_addrinfo.c
+++ b/lib/curl_addrinfo.c
@@ -208,6 +208,18 @@ Curl_getaddrinfo_ex(const char *nodename,
Curl_freeaddrinfo(cafirst);
cafirst = NULL;
}
+ else if(!cafirst) {
+#ifdef EAI_NONAME
+ /* rfc3493 conformant */
+ error = EAI_NONAME;
+#else
+ /* rfc3493 obsoleted */
+ error = EAI_NODATA;
+#endif
+#ifdef USE_WINSOCK
+ SET_SOCKERRNO(error);
+#endif
+ }
*result = cafirst;