]> granicus.if.org Git - apache/commitdiff
Only parse cache size in parens at the end of the string. Fixes SSLSessionCache
authorStefan Fritsch <sf@apache.org>
Fri, 23 Oct 2009 19:27:32 +0000 (19:27 +0000)
committerStefan Fritsch <sf@apache.org>
Fri, 23 Oct 2009 19:27:32 +0000 (19:27 +0000)
directive mis-parsing parens in pathname.

PR: 47945

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

CHANGES
modules/cache/mod_socache_shmcb.c

diff --git a/CHANGES b/CHANGES
index f93bce9c24f09bf4091eae7a0cea2d374601eb28..c9694e600c5189d9577c1fa960b93951566f2b52 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,10 @@ Changes with Apache 2.3.3
      mod_proxy_ftp: NULL pointer dereference on error paths.
      [Stefan Fritsch <sf fritsch.de>, Joe Orton]
 
+  *) mod_socache_shmcb: Only parse cache size in parens at the end of the
+     string. Fixes SSLSessionCache directive mis-parsing parens in pathname.
+     PR 47945. [Stefan Fritsch]
+
   *) htpasswd: Improve out of disk space handling. PR 30877. [Stefan Fritsch]
 
   *) htpasswd: Use MD5 hash by default on all platforms. [Stefan Fritsch]
index 94ab25f1ef73c2710ece11057be95cf989db0dee..b9d688f62d16d6c92fe5c9ed339a83c9e05bf67c 100644 (file)
@@ -278,15 +278,11 @@ static const char *socache_shmcb_create(ap_socache_instance_t **context,
     
     ctx->data_file = path = ap_server_root_relative(p, arg);
 
-    cp = strchr(path, '(');
-    if (cp) {
+    cp = strrchr(path, '(');
+    cp2 = path + strlen(path) - 1;
+    if (cp && (*cp2 == ')')) {
         *cp++ = '\0';
-
-        if (!(cp2 = strchr(cp, ')'))) {
-            return "Invalid argument: no closing parenthesis";
-        }
-            
-        *cp2 = '\0';
+        *cp2  = '\0';
         
         ctx->shm_size = atoi(cp);