Prevent a crash if a non-existent internal RewriteMap is specified
authorEric Covener <covener@apache.org>
Mon, 8 Aug 2011 02:29:39 +0000 (02:29 +0000)
committerEric Covener <covener@apache.org>
Mon, 8 Aug 2011 02:29:39 +0000 (02:29 +0000)
in a server context with RewiteEngine off, then later referenced.

Submitted By: Ben Noordhuis
Reviewed By: covener

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1154808 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/mappers/mod_rewrite.c

diff --git a/CHANGES b/CHANGES
index 3d8c558f55b090813ddd4e16cbe0613a4503a7c7..7c527fa24ba70d916486298d950357cfdd8e6c18 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,11 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.3.15
 
+  *) mod_rewrite: Check validity of each internal (int:) RewriteMap even if the
+     RewriteEngine is disabled in server context, avoiding a crash while
+     referencing the invalid int: map at runtime. PR 50994.
+     [Ben Noordhuis <info noordhuis nl>]
+     
   *) mod_ssl, configure: require OpenSSL 0.9.7 or later. [Kaspar Brand]
 
   *) mod_ssl: remove ssl_toolkit_compat layer. [Kaspar Brand]
index 87855dd7ae521ba714c220b85c4316a651707480..0f6b61f2502d943f972fa7cef3e491b0c9efb4b4 100644 (file)
@@ -3043,7 +3043,7 @@ static const char *cmd_rewritemap(cmd_parms *cmd, void *dconf, const char *a1,
         newmap->cachename = NULL;
         newmap->func      = (char *(*)(request_rec *,char *))
                             apr_hash_get(mapfunc_hash, a2+4, strlen(a2+4));
-        if ((sconf->state == ENGINE_ENABLED) && (newmap->func == NULL)) {
+        if (newmap->func == NULL) {
             return apr_pstrcat(cmd->pool, "RewriteMap: internal map not found:",
                                a2+4, NULL);
         }
@@ -3064,7 +3064,7 @@ static const char *cmd_rewritemap(cmd_parms *cmd, void *dconf, const char *a1,
     newmap->fpin  = NULL;
     newmap->fpout = NULL;
 
-    if (newmap->checkfile && (sconf->state == ENGINE_ENABLED)
+    if (newmap->checkfile
         && (apr_stat(&st, newmap->checkfile, APR_FINFO_MIN,
                      cmd->pool) != APR_SUCCESS)) {
         return apr_pstrcat(cmd->pool,