From 2c619e8bd62414b5a03f8904b38f6b75e1df89ab Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Mon, 26 Nov 2007 14:56:12 +0000 Subject: [PATCH] mod_filter: don't segfault on (unsupported) chained FilterProviders. PR 43956 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@598299 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/filters/mod_filter.c | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index b676469457..7fff2d6c30 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) mod_filter: Don't segfault on (unsupported) chained FilterProvider usage. + PR 43956 [Nick Kew] + *) mod_unique_id: Fix timestamp value in UNIQUE_ID. PR 37064 [Kobayashi ] diff --git a/modules/filters/mod_filter.c b/modules/filters/mod_filter.c index dfb0fde65b..b072119e37 100644 --- a/modules/filters/mod_filter.c +++ b/modules/filters/mod_filter.c @@ -137,7 +137,12 @@ static int filter_init(ap_filter_t *f) harness_ctx *fctx = apr_pcalloc(f->r->pool, sizeof(harness_ctx)); for (p = filter->providers; p; p = p->next) { - if (p->frec->filter_init_func) { + if (p->frec->filter_init_func == filter_init) { + ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, f->c, + "Chaining of FilterProviders not supported"); + return HTTP_INTERNAL_SERVER_ERROR; + } + else if (p->frec->filter_init_func) { f->ctx = NULL; if ((err = p->frec->filter_init_func(f)) != OK) { ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, f->c, -- 2.40.0