]> granicus.if.org Git - apache/commitdiff
mod_proxy_{ajp,fcgi}: Fix a possible crash when reusing an established
authorYann Ylavic <ylavic@apache.org>
Thu, 22 Dec 2016 23:30:05 +0000 (23:30 +0000)
committerYann Ylavic <ylavic@apache.org>
Thu, 22 Dec 2016 23:30:05 +0000 (23:30 +0000)
backend connection, happening with LogLevel trace2 or higher configured,
or at any log level with compilers not detected as C99 compliant (e.g.
MSVC on Windows).

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

CHANGES
modules/proxy/proxy_util.c

diff --git a/CHANGES b/CHANGES
index e6dadc3ebf6da602823f0aadfb4dd5db4b8a719c..92e1c4bdf3c6d7077b00f13e7a0b4345c801629d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,11 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy_{ajp,fcgi}: Fix a possible crash when reusing an established
+     backend connection, happening with LogLevel trace2 or higher configured,
+     or at any log level with compilers not detected as C99 compliant (e.g.
+     MSVC on Windows).  [Yann Ylavic]
+
   *) mod_ext_filter: Don't interfere with "error buckets" issued by other
      modules. PR60375.  [Eric Covener, Lubos Uhliarik]
 
index 8aec33337da4e0708f9597886ce735b579e3a859..1f439c7588d559db5ac45b5869e691745b523f06 100644 (file)
@@ -2754,10 +2754,13 @@ PROXY_DECLARE(apr_status_t) ap_proxy_check_connection(const char *scheme,
     }
 
     if (rv == APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_TRACE2, 0, server,
-                     "%s: reusing backend connection %pI<>%pI",
-                     scheme, conn->connection->local_addr,
-                     conn->connection->client_addr);
+        if (APLOGtrace2(server)) {
+            apr_sockaddr_t *local_addr = NULL;
+            apr_socket_addr_get(&local_addr, APR_LOCAL, conn->sock);
+            ap_log_error(APLOG_MARK, APLOG_TRACE2, 0, server,
+                         "%s: reusing backend connection %pI<>%pI",
+                         scheme, local_addr, conn->addr);
+        }
     }
     else if (conn->sock) {
         /* This clears conn->scpool (and associated data), so backup and