Skip to content

Commit eecbbca

Browse files
committed
mod_authn_socache: validate URL earlier
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1933357 13f79535-47bb-0310-9956-ffa450edef68
1 parent cd41433 commit eecbbca

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

modules/aaa/mod_authn_socache.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,10 @@ static const command_rec authn_cache_cmds[] =
265265
static const char *construct_key(request_rec *r, const char *context,
266266
const char *user, const char *realm)
267267
{
268+
const char *slash = ap_strrchr_c(r->uri, '/');
268269
/* handle "special" context values */
269-
if (!strcmp(context, directory)) {
270-
/* FIXME: are we at risk of this blowing up? */
270+
if (!strcmp(context, directory) && slash) {
271271
char *new_context;
272-
char *slash = strrchr(r->uri, '/');
273272
new_context = apr_palloc(r->pool, slash - r->uri +
274273
strlen(r->server->server_hostname) + 1);
275274
strcpy(new_context, r->server->server_hostname);

0 commit comments

Comments
 (0)