]> granicus.if.org Git - apache/commitdiff
Correct bogus code; stack alloc of variable length is not portable from C++.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 7 Apr 2010 04:39:43 +0000 (04:39 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 7 Apr 2010 04:39:43 +0000 (04:39 +0000)
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

index 18dfc53d10391b81992ab8bd21a7928fe70626d1..59cbc3b4480cc3f7bd3cd5329dc32aa43da7872a 100644 (file)
@@ -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)) {