From 380a1e9d084112a5360b69ac98686daccc8c5edb Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 7 Apr 2010 04:39:43 +0000 Subject: [PATCH] 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 --- modules/proxy/mod_proxy.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 18dfc53d10..59cbc3b448 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)) { -- 2.50.1