You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2010/04/07 06:39:43 UTC
svn commit: r931432 - /httpd/httpd/trunk/modules/proxy/mod_proxy.c
Author: wrowe
Date: Wed Apr 7 04:39:43 2010
New Revision: 931432
URL: http://svn.apache.org/viewvc?rev=931432&view=rev
Log:
Correct bogus code; stack alloc of variable length is not portable from C++.
And look, there's an apr for that.
Modified:
httpd/httpd/trunk/modules/proxy/mod_proxy.c
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.c?rev=931432&r1=931431&r2=931432&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.c Wed Apr 7 04:39:43 2010
@@ -382,14 +382,15 @@ static const char *set_balancer_param(pr
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)) {