]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1782986 from trunk:
authorJoe Orton <jorton@apache.org>
Tue, 12 Oct 2021 08:13:29 +0000 (08:13 +0000)
committerJoe Orton <jorton@apache.org>
Tue, 12 Oct 2021 08:13:29 +0000 (08:13 +0000)
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

server/util_filter.c

index 51e24f67e8e1c8a033b82906e378a3119ca579e6..664f649b395e9915715cc35c837376d8d365c3b4 100644 (file)
@@ -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