From: Jim Jagielski Date: Thu, 18 Jun 2015 17:05:28 +0000 (+0000) Subject: Merge r1686085 from trunk: X-Git-Tag: 2.4.15~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa3b168721d856389e0a4b4c91f170db68cdd7ac;p=thirdparty%2Fapache%2Fhttpd.git Merge r1686085 from trunk: *) mod_ext_filter, mod_charset_lite: Avoid inadvertent filtering of protocol data during read of chunked request bodies. PR 58049. [Edward Lu ] Submitted By: Edward Lu Submitted by: covener Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1686272 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 6e28a3f2ba5..05409abdb61 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ Changes with Apache 2.4.15 + *) mod_ext_filter, mod_charset_lite: Avoid inadvertent filtering of protocol + data during read of chunked request bodies. PR 58049. + [Edward Lu ] + *) core: Allow spaces after chunk-size for compatibility with implementations using a pre-filled buffer. [Yann Ylavic, Jeff Trawick] diff --git a/STATUS b/STATUS index 7e3591fa546..db714a00329 100644 --- a/STATUS +++ b/STATUS @@ -107,11 +107,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - *) mod_charset_lite, mod_ext_filter: Avoid inadvertent filtering of protocol - data during read of chunked request bodies. PR 58049. - trunk patch: http://svn.apache.org/r1686085 - 2.4.x patch: trunk works - +1 covener, trawick, ylavic PATCHES PROPOSED TO BACKPORT FROM TRUNK: diff --git a/modules/filters/mod_charset_lite.c b/modules/filters/mod_charset_lite.c index 934f04774d4..e05517b8515 100644 --- a/modules/filters/mod_charset_lite.c +++ b/modules/filters/mod_charset_lite.c @@ -984,6 +984,11 @@ static apr_status_t xlate_in_filter(ap_filter_t *f, apr_bucket_brigade *bb, apr_size_t buffer_size; int hit_eos; + /* just get out of the way of things we don't want. */ + if (mode != AP_MODE_READBYTES) { + return ap_get_brigade(f->next, bb, mode, block, readbytes); + } + if (!ctx) { /* this is SetInputFilter path; grab the preallocated context, * if any; note that if we decided not to do anything in an earlier diff --git a/modules/filters/mod_ext_filter.c b/modules/filters/mod_ext_filter.c index 1e383f084cb..4f97acae076 100644 --- a/modules/filters/mod_ext_filter.c +++ b/modules/filters/mod_ext_filter.c @@ -891,6 +891,11 @@ static apr_status_t ef_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, ef_ctx_t *ctx = f->ctx; apr_status_t rv; + /* just get out of the way of things we don't want. */ + if (mode != AP_MODE_READBYTES) { + return ap_get_brigade(f->next, bb, mode, block, readbytes); + } + if (!ctx) { if ((rv = init_filter_instance(f)) != APR_SUCCESS) { ctx = f->ctx;