]> granicus.if.org Git - apache/commitdiff
mod_charset_lite: Don't crash when the request has no associated
authorJeff Trawick <trawick@apache.org>
Wed, 7 Nov 2007 10:53:18 +0000 (10:53 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 7 Nov 2007 10:53:18 +0000 (10:53 +0000)
filename.

(r->filename unset)

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

CHANGES
modules/filters/mod_charset_lite.c

diff --git a/CHANGES b/CHANGES
index 4927df2ea89cd115097da49d99763f2cae5f646c..7caa227e58ff0f8c380cb07caee621fd77e58b44 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) mod_charset_lite: Don't crash when the request has no associated
+     filename.  [Jeff Trawick]
+
   *) mod_ssl: Fix TLS upgrade (RFC 2817) support.  PR 41231.  [Joe Orton]
 
   *) scoreboard: Correctly declare ap_time_process_request.
index bac785b0ed5c08ca48932cec52e63a3cb92db0bf..903b3923755d3fc1ecfb2e7417b6f3a230a9457f 100644 (file)
@@ -206,7 +206,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 */
@@ -229,10 +231,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;