]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* server/listen.c (open_listeners): Fix logic error caught by
authorJoe Orton <jorton@apache.org>
Fri, 2 Dec 2011 11:28:44 +0000 (11:28 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 2 Dec 2011 11:28:44 +0000 (11:28 +0000)
  Coverity; possible NULL pointer deref at startup with a
  particular (and unlikely) listener/system config.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209417 13f79535-47bb-0310-9956-ffa450edef68

server/listen.c

index 8cbf80ae52c1f149647a3a0ec385b55d5073a16d..fd232317da9b750e5f820bd0d20d5f02f322335b 100644 (file)
@@ -416,7 +416,7 @@ static int open_listeners(apr_pool_t *pool)
              * listen (which would generate an error). IPv4 will be handled
              * on the established IPv6 socket.
              */
-            if (IS_INADDR_ANY(lr->bind_addr)) {
+            if (IS_INADDR_ANY(lr->bind_addr) && previous) {
                 for (cur = ap_listeners; cur != lr; cur = cur->next) {
                     if (lr->bind_addr->port == cur->bind_addr->port
                         && IS_IN6ADDR_ANY(cur->bind_addr)