summaryrefslogtreecommitdiff
path: root/buckets
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2022-01-07 16:05:27 +0000
committerYann Ylavic <ylavic@apache.org>2022-01-07 16:05:27 +0000
commit36260ba4dfbb98ddc3c98226afce71ef9a1dfd5e (patch)
treeefbf905c4ab3e8316a47a7f81c43037abbbafb9e /buckets
parent61a479e4f3352f86e7abb9f452ef6c553ed351cb (diff)
downloadapr-36260ba4dfbb98ddc3c98226afce71ef9a1dfd5e.tar.gz
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
Diffstat (limited to 'buckets')
-rw-r--r--buckets/apr_buckets_file.c5
1 files changed, 1 insertions, 4 deletions
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;
}