summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorChristophe Jaillet <jailletc36@apache.org>2020-02-15 15:22:22 +0100
committerChristophe Jaillet <jailletc36@apache.org>2020-02-15 15:22:22 +0100
commitb1a82c2ce37a3167241e23c7dc5c6023a07ab9a0 (patch)
treef38c204c40e2871527aff4ed4e99a958704b9f7d /server
parent* server/mpm/event/event.c (event_open_logs): Avoid UBSan exception (diff)
downloadapache2-b1a82c2ce37a3167241e23c7dc5c6023a07ab9a0.tar.xz
apache2-b1a82c2ce37a3167241e23c7dc5c6023a07ab9a0.zip
Avoid UBSan exception calling memcpy(,NULL,0) at startup.
Follow-up to r1874011 which did the same for the event MPM. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874055 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/mpm/worker/worker.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c
index 60ec82b93a..7c7a75cf0b 100644
--- a/server/mpm/worker/worker.c
+++ b/server/mpm/worker/worker.c
@@ -1967,8 +1967,9 @@ static int worker_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
new_max = num_buckets;
}
new_ptr = (int *)apr_palloc(ap_pglobal, new_max * sizeof(int));
- memcpy(new_ptr, retained->idle_spawn_rate,
- retained->mpm->num_buckets * sizeof(int));
+ if (retained->idle_spawn_rate) /* NULL at startup */
+ memcpy(new_ptr, retained->idle_spawn_rate,
+ etained->mpm->num_buckets * sizeof(int));
retained->idle_spawn_rate = new_ptr;
retained->mpm->max_buckets = new_max;
}