]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
rev 592694 from trunk:
authorJeff Trawick <trawick@apache.org>
Thu, 8 Nov 2007 14:52:20 +0000 (14:52 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 8 Nov 2007 14:52:20 +0000 (14:52 +0000)
mod_charset_lite: Don't crash when the request has no associated
filename.

Reviewed by: niq, rpluem

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

CHANGES
STATUS
modules/filters/mod_charset_lite.c

diff --git a/CHANGES b/CHANGES
index 12e6522ebf361c618cc3c02e923f1e0b339ece04..f5e63c2886fc4d9446a2a5627288a9935e4b9b0b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.7
 
+  *) mod_charset_lite: Don't crash when the request has no associated
+     filename.  [Jeff Trawick]
+
   *) Core: fix possible crash at startup in case of nonexistent DocumentRoot.
      PR 39722 [Adrian Buckley <adrian.buckley ntlworld.com>]
 
diff --git a/STATUS b/STATUS
index 4e1daa8cae28a9079528876d3831f866b40e0e12..edb5ed3e4ef7cc38b4dd0bb004fbba3b7ca55525 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -79,14 +79,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * mod_charset_lite: Don't crash when the request has no associated
-     filename.
-     trunk:
-       http://svn.apache.org/viewvc?rev=592694&view=rev
-     2.2.x patch:
-       trunk patch works
-     +1: trawick, niq, rpluem
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 
index e7df32b148a4009c83da90f3f5c9ca4ffce1a196..5b7d7c892503f888448e8d631e03283404a5f479 100644 (file)
@@ -205,7 +205,9 @@ static int find_code_page(request_rec *r)
         ap_log_rerror(APLOG_MARK,APLOG_DEBUG, 0, r,
                       "uri: %s file: %s method: %d "
                       "imt: %s flags: %s%s%s %s->%s",
-                      r->uri, r->filename, r->method_number,
+                      r->uri,
+                      r->filename ? r->filename : "(none)",
+                      r->method_number,
                       r->content_type ? r->content_type : "(unknown)",
                       r->main     ? "S" : "",    /* S if subrequest */
                       r->prev     ? "R" : "",    /* R if redirect */
@@ -228,10 +230,13 @@ static int find_code_page(request_rec *r)
     /* catch proxy requests */
     if (r->proxyreq) return DECLINED;
     /* mod_rewrite indicators */
-    if (!strncmp(r->filename, "redirect:", 9)) return DECLINED;
-    if (!strncmp(r->filename, "gone:", 5)) return DECLINED;
-    if (!strncmp(r->filename, "passthrough:", 12)) return DECLINED;
-    if (!strncmp(r->filename, "forbidden:", 10)) return DECLINED;
+    if (r->filename
+        && (!strncmp(r->filename, "redirect:", 9)
+            || !strncmp(r->filename, "gone:", 5)
+            || !strncmp(r->filename, "passthrough:", 12)
+            || !strncmp(r->filename, "forbidden:", 10))) {
+        return DECLINED;
+    }
     /* no translation when server and network charsets are set to the same value */
     if (!strcasecmp(dc->charset_source, dc->charset_default)) return DECLINED;