You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2016/12/22 23:30:05 UTC

svn commit: r1775775 - in /httpd/httpd/trunk: CHANGES modules/proxy/proxy_util.c

Author: ylavic
Date: Thu Dec 22 23:30:05 2016
New Revision: 1775775

URL: http://svn.apache.org/viewvc?rev=1775775&view=rev
Log:
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).


Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/proxy/proxy_util.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1775775&r1=1775774&r2=1775775&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Thu Dec 22 23:30:05 2016
@@ -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]
 

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=1775775&r1=1775774&r2=1775775&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Thu Dec 22 23:30:05 2016
@@ -2754,10 +2754,13 @@ PROXY_DECLARE(apr_status_t) ap_proxy_che
     }
 
     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