You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2016/06/22 20:43:30 UTC
[trafficserver] branch master updated: TS-4571: Fix "pointer to
local outside scope" (CID 1356978) (#727)
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 0597cfe TS-4571: Fix "pointer to local outside scope" (CID 1356978) (#727)
0597cfe is described below
commit 0597cfefed63ec29fd210953226da89b25bf9f15
Author: Phil Sorber <so...@apache.org>
AuthorDate: Wed Jun 22 14:43:23 2016 -0600
TS-4571: Fix "pointer to local outside scope" (CID 1356978) (#727)
---
proxy/ParentSelection.cc | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/proxy/ParentSelection.cc b/proxy/ParentSelection.cc
index 69fd061..43db4ef 100644
--- a/proxy/ParentSelection.cc
+++ b/proxy/ParentSelection.cc
@@ -516,6 +516,7 @@ ParentRecord::Init(matcher_line *line_info)
char *val;
bool used = false;
ParentRR_t round_robin = P_NO_ROUND_ROBIN;
+ char buf[128];
this->line_num = line_info->line_num;
this->scheme = NULL;
@@ -595,8 +596,8 @@ ParentRecord::Init(matcher_line *line_info)
max_simple_retries = v;
used = true;
} else {
- char buf[128];
- sprintf(buf, "invalid argument to max_simple_retries. Argument must be between 1 and %d.", MAX_SIMPLE_RETRIES);
+ snprintf(buf, sizeof(buf), "invalid argument to max_simple_retries. Argument must be between 1 and %d.",
+ MAX_SIMPLE_RETRIES);
errPtr = buf;
}
} else if (strcasecmp(label, "max_unavailable_server_retries") == 0) {
@@ -605,9 +606,8 @@ ParentRecord::Init(matcher_line *line_info)
max_unavailable_server_retries = v;
used = true;
} else {
- char buf[128];
- sprintf(buf, "invalid argument to max_unavailable_server_retries. Argument must be between 1 and %d.",
- MAX_UNAVAILABLE_SERVER_RETRIES);
+ snprintf(buf, sizeof(buf), "invalid argument to max_unavailable_server_retries. Argument must be between 1 and %d.",
+ MAX_UNAVAILABLE_SERVER_RETRIES);
errPtr = buf;
}
}
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].