summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2021-10-12 08:13:29 +0000
committerJoe Orton <jorton@apache.org>2021-10-12 08:13:29 +0000
commit857df905d21fbf7133c4192bc496a4fcb164d23a (patch)
treefccb9a4664cbc7c400e3dd2b176c6ab4126312f3
parent7b205dd8ff3c20f0c261509c32c0c99b8b699d6f (diff)
downloadhttpd-857df905d21fbf7133c4192bc496a4fcb164d23a.tar.gz
Merge r1782986 from trunk:
util_filter: better ap_pass_brigade() vs empty brigades. Submitted by: ylavic Reviewed by: jorton, rpluem, ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1894150 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--server/util_filter.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/util_filter.c b/server/util_filter.c
index 51e24f67e8..664f649b39 100644
--- a/server/util_filter.c
+++ b/server/util_filter.c
@@ -565,8 +565,9 @@ AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *next,
apr_bucket_brigade *bb)
{
if (next) {
- apr_bucket *e;
- if ((e = APR_BRIGADE_LAST(bb)) && APR_BUCKET_IS_EOS(e) && next->r) {
+ apr_bucket *e = APR_BRIGADE_LAST(bb);
+
+ if (e != APR_BRIGADE_SENTINEL(bb) && APR_BUCKET_IS_EOS(e) && next->r) {
/* This is only safe because HTTP_HEADER filter is always in
* the filter stack. This ensures that there is ALWAYS a
* request-based filter that we can attach this to. If the