From 36260ba4dfbb98ddc3c98226afce71ef9a1dfd5e Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Fri, 7 Jan 2022 16:05:27 +0000 Subject: apr_buckets_file: Always use the given pool for FILE buckets set aside. Using an ancestor pool might race if the bucket is reopened (XTHREAD) or mmap()ed later in file_bucket_read(), while there is nothing wrong with both the bucket and the file having the given/same lifetime. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896812 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_buckets_file.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'buckets') diff --git a/buckets/apr_buckets_file.c b/buckets/apr_buckets_file.c index be0bda0d8..f0eab5a18 100644 --- a/buckets/apr_buckets_file.c +++ b/buckets/apr_buckets_file.c @@ -239,18 +239,15 @@ static apr_status_t file_bucket_setaside(apr_bucket *b, apr_pool_t *reqpool) new = apr_bucket_alloc(sizeof(*new), b->list); memcpy(new, a, sizeof(*new)); new->refcount.refcount = 1; - new->readpool = reqpool; a->refcount.refcount--; a = b->data = new; } else { apr_file_setaside(&fd, f, reqpool); - if (!apr_pool_is_ancestor(a->readpool, reqpool)) { - a->readpool = reqpool; - } } a->fd = fd; + a->readpool = reqpool; return APR_SUCCESS; } -- cgit v1.2.1