From: Rainer Jung Date: Mon, 22 Jul 2019 19:28:14 +0000 (+0000) Subject: core: fix crash when running with apr lib build with APR_POOL_DEBUG. X-Git-Tag: 2.4.40~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27734254566fff9de76af408ce9e3fc324b157ce;p=thirdparty%2Fapache%2Fhttpd.git core: fix crash when running with apr lib build with APR_POOL_DEBUG. Observed with huge config and mod_security using long config lines. Backport of r1863179 from trunk. Proposed by: rjung Backported by: rjung Reviewed by: rjung, icing, jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1863596 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 19220eccb23..d4bff2788f0 100644 --- a/STATUS +++ b/STATUS @@ -143,13 +143,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: https://svn.apache.org/repos/asf/httpd/httpd/patches/2.4.x/ssl-certicate-hooks.patch +1: icing, jorton, jim - *) core: fix crash when running with apr lib build with APR_POOL_DEBUG. - Observed with huge config and mod_security using long config lines. - trunk: - http://svn.apache.org/r1863179 - 2.4.x patch: svn merge -c 1863179 ^/httpd/httpd/trunk . - +1: rjung, icing, jim - *) mod_proxy_hcheck: mod_proxy_hcheck: mute "run from watchdog" message. This is way too verbose (every 100ms) to be logged at any LogLevel. CHANGES suggestion: diff --git a/server/util.c b/server/util.c index 5cdd71d5683..59027917c0c 100644 --- a/server/util.c +++ b/server/util.c @@ -2902,6 +2902,11 @@ AP_DECLARE(void) ap_varbuf_grow(struct ap_varbuf *vb, apr_size_t new_len) /* The required block is rather larger. Use allocator directly so that * the memory can be freed independently from the pool. */ allocator = apr_pool_allocator_get(vb->pool); + /* Happens if APR was compiled with APR_POOL_DEBUG */ + if (allocator == NULL) { + apr_allocator_create(&allocator); + ap_assert(allocator != NULL); + } if (new_len <= VARBUF_MAX_SIZE) new_node = apr_allocator_alloc(allocator, new_len + APR_ALIGN_DEFAULT(sizeof(*new_info)));