From: William A. Rowe Jr Date: Wed, 7 Apr 2010 04:39:43 +0000 (+0000) Subject: Correct bogus code; stack alloc of variable length is not portable from C++. X-Git-Tag: 2.3.6~251 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=380a1e9d084112a5360b69ac98686daccc8c5edb;p=thirdparty%2Fapache%2Fhttpd.git Correct bogus code; stack alloc of variable length is not portable from C++. And look, there's an apr for that. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@931432 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 18dfc53d103..59cbc3b4480 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -382,14 +382,15 @@ static const char *set_balancer_param(proxy_server_conf *conf, return "scolonpathdelim must be On|Off"; } else if (!strcasecmp(key, "erroronstatus")) { - char valSplit[strlen(val)+1]; + char *val_split; char *status; char *tok_state; - strcpy(valSplit, val); + val_split = apr_pstrdup(p, val); + balancer->errstatuses = apr_array_make(p, 1, sizeof(int)); - status = apr_strtok(valSplit, ", ", &tok_state); + status = apr_strtok(val_split, ", ", &tok_state); while (status != NULL) { ival = atoi(status); if (ap_is_HTTP_VALID_RESPONSE(ival)) {