From: Yann Ylavic Date: Tue, 14 Feb 2017 16:43:25 +0000 (+0000) Subject: util_filter: better ap_pass_brigade() vs empty brigades. X-Git-Tag: 2.5.0-alpha~660 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=065e8248bdff70d2deb3b86ce8ec49c1408c5154;p=apache util_filter: better ap_pass_brigade() vs empty brigades. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1782986 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/util_filter.c b/server/util_filter.c index 25ed63434d..ccfef6c254 100644 --- a/server/util_filter.c +++ b/server/util_filter.c @@ -584,9 +584,9 @@ AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *next, apr_bucket_brigade *bb) { if (next) { - apr_bucket *e; + apr_bucket *e = APR_BRIGADE_LAST(bb); - if ((e = APR_BRIGADE_LAST(bb)) && APR_BUCKET_IS_EOS(e) && next->r) { + 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