From 24042b33629a40ce6b0553d3792bee70b25600e1 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 4 Sep 2008 14:27:55 +0000 Subject: [PATCH] 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. --- TargetGroup.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TargetGroup.cc b/TargetGroup.cc index d2059667f..4426e5805 100644 --- a/TargetGroup.cc +++ b/TargetGroup.cc @@ -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);