]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fix crashes when running with debug APR (APR_POOL_DEBUG),
authorRainer Jung <rjung@apache.org>
Tue, 16 Jul 2019 20:38:18 +0000 (20:38 +0000)
committerRainer Jung <rjung@apache.org>
Tue, 16 Jul 2019 20:38:18 +0000 (20:38 +0000)
because all pools have NULL allocators then.

This workaround is probably not very efficient,
but is only used when we do APR_POOL_DEBUG
and efficiency shouldn't be a big concern then.

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

server/util.c

index b56334754366dd83c4ca0550ff767b80976b720d..044b073bf583b7e59f1f342efecb9c8010a6c9b6 100644 (file)
@@ -2994,6 +2994,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)));