]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* Prevent r->parsed_uri.path from being NULL as this can cause segmentation
authorRuediger Pluem <rpluem@apache.org>
Mon, 10 Apr 2006 19:59:33 +0000 (19:59 +0000)
committerRuediger Pluem <rpluem@apache.org>
Mon, 10 Apr 2006 19:59:33 +0000 (19:59 +0000)
  faults e.g. in mod_cache. Set it to "/" in this case.

PR: 39259
Submitted by: Davi Arnaut <davi haxent.com.br>
Reviewed by: rpluem

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

CHANGES
server/protocol.c

diff --git a/CHANGES b/CHANGES
index c360bbc4a4eda113757cdaf5b5a30151ecc7f86a..906a7bbb0c1aedaa259514dd2a011eabc1f2c8df 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
   [Remove entries to the current 2.0 and 2.2 section below, when backported]
 
+  *) core: Set the path of a parsed uri in a request to "/" if the path is
+     NULL. PR 39259. [Davi Arnaut <davi haxent.com.br>]
+
   *) htdbm: Warn the user when adding a plaintext password on a platform
      where it wouldn't work with the server (i.e., anywhere that has
      crypt()).  [Jeff Trawick]
index 9f792ecce2458195be0aace9e1c67b73a62ba5b7..6798a388071c3a624946ce487e63bf5a72def6d7 100644 (file)
@@ -518,9 +518,11 @@ AP_CORE_DECLARE(void) ap_parse_uri(request_rec *r, const char *uri)
             r->hostname = r->parsed_uri.hostname;
         }
 
+        if (r->parsed_uri.path == NULL)
+            r->parsed_uri.path = apr_pstrdup(r->pool, "/");
+
         r->args = r->parsed_uri.query;
-        r->uri = r->parsed_uri.path ? r->parsed_uri.path
-                 : apr_pstrdup(r->pool, "/");
+        r->uri = r->parsed_uri.path;
 
 #if defined(OS2) || defined(WIN32)
         /* Handle path translations for OS/2 and plug security hole.