Check for the linked list returned by getaddrinfo being NULL as well as a

non-zero return code in TargetGroup.cc. Apparently on Windows XP SP3 at least
getaddrinfo can return success but give you an empty list.
This commit is contained in:
david 2008-09-04 14:27:55 +00:00
parent fa034c1ac9
commit 24042b3362

View file

@ -299,7 +299,7 @@ int TargetGroup::parse_expr(const char * const target_expr, int af) {
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_INET6;
rc = getaddrinfo(hostexp, NULL, &hints, &result);
if (rc != 0) {
if (rc != 0 || result == NULL) {
error("Failed to resolve given IPv6 hostname/IP: %s. Note that you can't use '/mask' or '[1-4,7,100-]' style ranges for IPv6. Error code %d: %s", hostexp, rc, gai_strerror(rc));
free(hostexp);
if (result) freeaddrinfo(result);