]> granicus.if.org Git - apache/commitdiff
util_filter: better ap_pass_brigade() vs empty brigades.
authorYann Ylavic <ylavic@apache.org>
Tue, 14 Feb 2017 16:43:25 +0000 (16:43 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 14 Feb 2017 16:43:25 +0000 (16:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1782986 13f79535-47bb-0310-9956-ffa450edef68

server/util_filter.c

index 25ed63434d32b7b812fe225fab9c1288ae6e27be..ccfef6c254b191f325dfd8b9aae456e81bdbaebd 100644 (file)
@@ -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