]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) mod_proxy: Fix icomplete initialization of BalancerMember(s) from the
authorStefan Eissing <icing@apache.org>
Tue, 10 Aug 2021 08:32:35 +0000 (08:32 +0000)
committerStefan Eissing <icing@apache.org>
Tue, 10 Aug 2021 08:32:35 +0000 (08:32 +0000)
                balancer-manager, which can lead to a crash.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1892165 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/proxy/proxy_util.c

diff --git a/CHANGES b/CHANGES
index 1322a4a8a45e8121c8f8b70f31b4f6f3720f3779..9aa3971189ecfef3cce4bf3f756946c22c54c259 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.49
 
+  *) mod_proxy: Fix icomplete initialization of BalancerMember(s) from the
+     balancer-manager, which can lead to a crash.  [Yann Ylavic]
+
   *) mpm_event: Fix graceful stop/restart of children processes if connections
      are in lingering close for too long.  [Yann Ylavic]
 
index 9ad5b56f228cbaf99c7b8420bacb00f35caf4eaa..a87501ed6c5ffaead4184fa264fce204feeea4b7 100644 (file)
@@ -3608,18 +3608,15 @@ PROXY_DECLARE(apr_status_t) ap_proxy_sync_balancer(proxy_balancer *b, server_rec
         }
         if (!found) {
             proxy_worker **runtime;
+            /* XXX: a thread mutex is maybe enough here */
             apr_global_mutex_lock(proxy_mutex);
             runtime = apr_array_push(b->workers);
-            *runtime = apr_palloc(conf->pool, sizeof(proxy_worker));
+            *runtime = apr_pcalloc(conf->pool, sizeof(proxy_worker));
             apr_global_mutex_unlock(proxy_mutex);
             (*runtime)->hash = shm->hash;
-            (*runtime)->context = NULL;
-            (*runtime)->cp = NULL;
             (*runtime)->balancer = b;
             (*runtime)->s = shm;
-#if APR_HAS_THREADS
-            (*runtime)->tmutex = NULL;
-#endif
+
             rv = ap_proxy_initialize_worker(*runtime, s, conf->pool);
             if (rv != APR_SUCCESS) {
                 ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s, APLOGNO(00966) "Cannot init worker");