mod_cache: avoid unlikely access to freed memory.
Submitted by: ylavic
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1638070 13f79535-47bb-0310-9956-
ffa450edef68
*) mod_dav: Set r->status_line in dav_error_response. PR 55426.
- *) mod_proxy_http: Avoid (unlikely) access to freed memory. [Yann Ylavic]
+ *) mod_proxy_http, mod_cache: Avoid (unlikely) accesses to freed memory.
+ [Yann Ylavic, Christophe Jaillet]
*) http_protocol: fix logic in ap_method_list_(add|remove) in order:
- to correctly reset bits
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_cache: Avoid another (unlikely) access to freed memory.
- trunk patch: http://svn.apache.org/r1632740
- 2.4.x patch: http://people.apache.org/~ylavic/httpd-2.4.x-apr_bucket_delete_new_fix.patch
- +1: ylavic, jailletc36, trawick
- ylavic: No CHANGES entry is added but rather the existing one for the same
- issue in mod_proxy_http (2.4.11's backport r1632736) has been modified.
-
* core: Support custom ErrorDocuments for HTTP 501 and 414 status codes.
PR 57167
trunk patch: http://svn.apache.org/r1635762
static apr_status_t cache_out_filter(ap_filter_t *f, apr_bucket_brigade *in)
{
request_rec *r = f->r;
- apr_bucket *e;
cache_request_rec *cache = (cache_request_rec *)f->ctx;
if (!cache) {
"cache: running CACHE_OUT filter");
/* clean out any previous response up to EOS, if any */
- for (e = APR_BRIGADE_FIRST(in);
- e != APR_BRIGADE_SENTINEL(in);
- e = APR_BUCKET_NEXT(e))
- {
+ while (!APR_BRIGADE_EMPTY(in)) {
+ apr_bucket *e = APR_BRIGADE_FIRST(in);
if (APR_BUCKET_IS_EOS(e)) {
apr_bucket_brigade *bb = apr_brigade_create(r->pool,
r->connection->bucket_alloc);