You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2011/08/08 04:29:39 UTC

svn commit: r1154808 - in /httpd/httpd/trunk: CHANGES modules/mappers/mod_rewrite.c

Author: covener
Date: Mon Aug  8 02:29:39 2011
New Revision: 1154808

URL: http://svn.apache.org/viewvc?rev=1154808&view=rev
Log:
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


Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/mappers/mod_rewrite.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1154808&r1=1154807&r2=1154808&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Mon Aug  8 02:29:39 2011
@@ -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]

Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?rev=1154808&r1=1154807&r2=1154808&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Mon Aug  8 02:29:39 2011
@@ -3043,7 +3043,7 @@ static const char *cmd_rewritemap(cmd_pa
         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_pa
     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,