]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r598299, r599393 from trunk:
authorJim Jagielski <jim@apache.org>
Sat, 8 Dec 2007 14:07:25 +0000 (14:07 +0000)
committerJim Jagielski <jim@apache.org>
Sat, 8 Dec 2007 14:07:25 +0000 (14:07 +0000)
mod_filter: don't segfault on (unsupported) chained FilterProviders.
PR 43956

Since we don't support chained filters, and can't expect to while the
filter_init problem remains, we should make it clear to users at startup time.

Submitted by: niq
Reviewed by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@602472 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/filters/mod_filter.c

diff --git a/CHANGES b/CHANGES
index a7a20909c3a18ec8653663fd5106c1e0174f0e0f..f8f4b8ba18cf505ce149efccd8a85ff7c9fa2ce6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.7
 
+  *) mod_filter: Don't segfault on (unsupported) chained FilterProvider usage.
+     PR 43956 [Nick Kew, Ruediger Pluem]
+
   *) core: Handle unrecognised transfer-encodings.
      PR 43882 [Nick Kew, Jeff Trawick]
 
diff --git a/STATUS b/STATUS
index c2fcf66219866659e574aaaedc3c759730107859..7a9d22a32b331a440088961e8ebaafc0de0fa462 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -79,12 +79,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  * mod_filter: Don't try to support chained filters when it doesn't work
-    PR 43956
-    http://svn.apache.org/viewvc?view=rev&revision=598299
-    http://svn.apache.org/viewvc?view=rev&revision=599393
-    +1: niq, rpluem, jim
-
   * http_protocol: Escape request method in 413 error reporting.
     Determined to be not generally exploitable, but a flaw in any case.
     PR 44014 [Victor Stinner <victor.stinner inl.fr>]
index 778895b46897288a903a75c9ab3d9bf46588de0b..3ba13c954ec74556d0d4ed894bd5044d7c600055 100644 (file)
@@ -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,
@@ -532,10 +537,6 @@ static const char *filter_provider(cmd_parms *cmd, void *CFG, const char *args)
 
     /* if provider has been registered, we can look it up */
     provider_frec = ap_get_output_filter_handle(pname);
-    if (!provider_frec) {
-        provider_frec = apr_hash_get(cfg->live_filters, pname,
-                                     APR_HASH_KEY_STRING);
-    }
     if (!provider_frec) {
         return apr_psprintf(cmd->pool, "Unknown filter provider %s", pname);
     }