From: Joe Orton Date: Tue, 12 Oct 2021 08:13:29 +0000 (+0000) Subject: Merge r1782986 from trunk: X-Git-Tag: candidate-2.4.52-rc1~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=857df905d21fbf7133c4192bc496a4fcb164d23a;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/server/util_filter.c b/server/util_filter.c index 51e24f67e8e..664f649b395 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