summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES6
-rw-r--r--network_io/unix/sockaddr.c12
2 files changed, 17 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 58b3277c6..daea26f28 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,11 @@
Changes with APR 0.9.5
+ *) Ensure that apr_sockaddr_info_get() does not return anything
+ other than AF_INET and AF_INET6 addresses. [Joe Orton]
+
+ *) Clarify that apr_dir_read() does not guarantee order of returned
+ entries as previously claimed. [Joe Orton]
+
*) The whole codebase was relicensed and is now available under
the Apache License, Version 2.0 (http://www.apache.org/licenses).
[Apache Software Foundation]
diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
index 9f89d4453..281c89d9f 100644
--- a/network_io/unix/sockaddr.c
+++ b/network_io/unix/sockaddr.c
@@ -380,7 +380,17 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa,
prev_sa = NULL;
ai = ai_list;
while (ai) { /* while more addresses to report */
- apr_sockaddr_t *new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t));
+ apr_sockaddr_t *new_sa;
+
+ /* Ignore anything bogus: getaddrinfo in some old versions of
+ * glibc will return AF_UNIX entries for AF_UNSPEC+AI_PASSIVE
+ * lookups. */
+ if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) {
+ ai = ai->ai_next;
+ continue;
+ }
+
+ new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t));
new_sa->pool = p;
memcpy(&new_sa->sa, ai->ai_addr, ai->ai_addrlen);