]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1933357 from trunk:
authorEric Covener <covener@apache.org>
Sun, 26 Apr 2026 16:29:24 +0000 (16:29 +0000)
committerEric Covener <covener@apache.org>
Sun, 26 Apr 2026 16:29:24 +0000 (16:29 +0000)
mod_authn_socache: validate URL earlier

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1933358 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_authn_socache.c

index 0e4454a4b12381e9f3c93538b9961d0066340cd5..0834ab43d324375062c1632c7dd6be42a235ae34 100644 (file)
@@ -266,11 +266,10 @@ static const command_rec authn_cache_cmds[] =
 static const char *construct_key(request_rec *r, const char *context,
                                  const char *user, const char *realm)
 {
+    const char *slash = ap_strrchr_c(r->uri, '/');
     /* handle "special" context values */
-    if (!strcmp(context, directory)) {
-        /* FIXME: are we at risk of this blowing up? */
+    if (!strcmp(context, directory) && slash) {
         char *new_context;
-        char *slash = strrchr(r->uri, '/');
         new_context = apr_palloc(r->pool, slash - r->uri +
                                  strlen(r->server->server_hostname) + 1);
         strcpy(new_context, r->server->server_hostname);