]> granicus.if.org Git - apache/commitdiff
Fix a segfault with mod_include when r->path_info is not set
authorJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 30 Aug 2001 21:29:15 +0000 (21:29 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 30 Aug 2001 21:29:15 +0000 (21:29 +0000)
(which is the case with mod_proxy).

My only question about this is whether we should place some value
(such as <UNKNOWN>) when path_info isn't set.

Submitted by: Ian Holsman <ianh@cnet.com>
Reviewed by: Justin Erenkrantz

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

CHANGES
modules/filters/mod_include.c

diff --git a/CHANGES b/CHANGES
index 94e156703949834ee6e428c8dfaa157b71d23f64..a1904447ad51a1bc954fa5f653083aa32af3049e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.26-dev
 
+  *) Fix a segfault with mod_include when r->path_info is not set
+     (which is the case with mod_proxy).  [Ian Holsman <ianh@cnet.com>]
+
   *) Add -X functionality back.  This indicates to all MPMs and any other
      part of Apache that it should run in "debug" mode.  [Justin Erenkrantz]
 
index b6c0ed1ad1608e008b3bf0303ef0991da8401b03..a516e9486f678b14ad0fb34ae3bc15bdc3da7401 100644 (file)
@@ -113,7 +113,9 @@ static void add_include_vars(request_rec *r, char *timefmt)
     apr_table_setn(e, "LAST_MODIFIED",
               ap_ht_time(r->pool, r->finfo.mtime, timefmt, 0));
     apr_table_setn(e, "DOCUMENT_URI", r->uri);
-    apr_table_setn(e, "DOCUMENT_PATH_INFO", r->path_info);
+    if (r->path_info && *r->path_info) {
+        apr_table_setn(e, "DOCUMENT_PATH_INFO", r->path_info);
+    }
     if (apr_get_username(&pwname, r->finfo.user, r->pool) == APR_SUCCESS) {
         apr_table_setn(e, "USER_NAME", pwname);
     }