From af5398f4275dd01ee4f00a5da7431527ab4a45ad Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 23 Oct 2009 19:27:32 +0000 Subject: [PATCH] Only parse cache size in parens at the end of the string. Fixes SSLSessionCache 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 | 4 ++++ modules/cache/mod_socache_shmcb.c | 12 ++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index f93bce9c24..c9694e600c 100644 --- 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 , 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] diff --git a/modules/cache/mod_socache_shmcb.c b/modules/cache/mod_socache_shmcb.c index 94ab25f1ef..b9d688f62d 100644 --- a/modules/cache/mod_socache_shmcb.c +++ b/modules/cache/mod_socache_shmcb.c @@ -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); -- 2.40.0