From: Jeff Trawick Date: Wed, 9 Nov 2011 04:23:13 +0000 (+0000) Subject: use non-'const char *' while building string to avoid warnings X-Git-Tag: 2.3.16~228 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2553e327e3a827537f9c86fddac304344b6e3367;p=apache use non-'const char *' while building string to avoid warnings git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199611 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/aaa/mod_authn_socache.c b/modules/aaa/mod_authn_socache.c index a11cf31617..317ce9f7bd 100644 --- a/modules/aaa/mod_authn_socache.c +++ b/modules/aaa/mod_authn_socache.c @@ -231,11 +231,13 @@ static const char *construct_key(request_rec *r, const char *context, /* handle "special" context values */ if (!strcmp(context, "directory")) { /* FIXME: are we at risk of this blowing up? */ + char *new_context; char *slash = strrchr(r->uri, '/'); - context = apr_palloc(r->pool, slash - r->uri + - strlen(r->server->server_hostname) + 1); - strcpy(context, r->server->server_hostname); - strncat(context, r->uri, slash - r->uri); + new_context = apr_palloc(r->pool, slash - r->uri + + strlen(r->server->server_hostname) + 1); + strcpy(new_context, r->server->server_hostname); + strncat(new_context, r->uri, slash - r->uri); + context = new_context; } else if (!strcmp(context, "server")) { context = r->server->server_hostname;