]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
backport r1154808 from trunk:
authorEric Covener <covener@apache.org>
Sat, 3 Sep 2011 22:54:25 +0000 (22:54 +0000)
committerEric Covener <covener@apache.org>
Sat, 3 Sep 2011 22:54:25 +0000 (22:54 +0000)
Prevent a crash if a non-existent internal RewriteMap is specified
in a server context with RewiteEngine off, then later referenced.

Submitted By: Ben Noordhuis
Reviewed By: covener, sf, trawick

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

CHANGES
modules/mappers/mod_rewrite.c

diff --git a/CHANGES b/CHANGES
index 550df4546f54a67b44171348fb9818520796cdfa..31ec1293c42061c1b02eebed33d954ed552474da 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,11 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.21
 
+ *) 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>]
+
   *) core: Add MaxRanges directive to control the number of ranges permitted
      before returning the entire resource, with a default limit of 200.
      [Eric Covener]
index 700107385f260b58ac875485e2f83d0b5558121c..8887bea53a3419bf34cc354ab8139485aeba81a5 100644 (file)
@@ -2978,7 +2978,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);
         }
@@ -2999,7 +2999,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,