From: Nick Kew Date: Wed, 9 Nov 2011 00:28:51 +0000 (+0000) Subject: mod_authn_socache: fix namespacing issue X-Git-Tag: 2.3.16~233 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=565f842bd27a59fb36f4c09b217acbe846f87255;p=apache mod_authn_socache: fix namespacing issue http://marc.info/?l=apache-httpd-dev&m=131823772714741&w=2 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199565 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/aaa/mod_authn_socache.c b/modules/aaa/mod_authn_socache.c index bfe4c7bf33..1f5f4b7e83 100644 --- a/modules/aaa/mod_authn_socache.c +++ b/modules/aaa/mod_authn_socache.c @@ -232,7 +232,11 @@ static const char *construct_key(request_rec *r, const char *context, if (!strcmp(context, "directory")) { /* FIXME: are we at risk of this blowing up? */ char *slash = strrchr(r->uri, '/'); - context = apr_pstrndup(r->pool, r->uri, slash - r->uri + 1); + context = apr_palloc(r->pool, slash - r->uri + + strlen(r->server->server_hostname) + 2); + strcpy(context, r->server->server_hostname); + strcat(context, ":"); + strncat(context, r->uri, slash - r->uri); } else if (!strcmp(context, "server")) { context = r->server->server_hostname;