Updated Branches: refs/heads/master b3d0fe7b5 -> 370fba9bf
TS-1806: bogus buffer sizing in CfgContextUtils.cc Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/370fba9b Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/370fba9b Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/370fba9b Branch: refs/heads/master Commit: 370fba9bf135df414be885403b8a4720cb35c696 Parents: b3d0fe7 Author: James Peach <[email protected]> Authored: Tue Apr 9 16:44:17 2013 -0700 Committer: James Peach <[email protected]> Committed: Tue Apr 9 16:44:17 2013 -0700 ---------------------------------------------------------------------- CHANGES | 2 ++ mgmt/api/CfgContextUtils.cc | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/370fba9b/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 11b87e4..59a196b 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,8 @@ Changes with Apache Traffic Server 3.3.2 + *) [TS-1806] bogus buffer sizing in CfgContextUtils.cc + *) [TS-1805] Fix stats ExpressionEval in stats xml. Author: Yunkai Zhang http://git-wip-us.apache.org/repos/asf/trafficserver/blob/370fba9b/mgmt/api/CfgContextUtils.cc ---------------------------------------------------------------------- diff --git a/mgmt/api/CfgContextUtils.cc b/mgmt/api/CfgContextUtils.cc index 97c8ba3..32cb139 100644 --- a/mgmt/api/CfgContextUtils.cc +++ b/mgmt/api/CfgContextUtils.cc @@ -344,13 +344,15 @@ port_list_to_string(PortList * ports, const char *delimiter) if (port_ele->port_b != TS_INVALID_PORT) { //. is this a range // add in range delimiter & end of range if (pos < sizeof(buf) && - (psize = snprintf(buf + pos, sizeof(buf) - pos, "%c%d", RANGE_DELIMITER, port_ele->port_b)) > 0) + (psize = snprintf(buf + pos, sizeof(buf) - pos, "%c%d", RANGE_DELIMITER, port_ele->port_b)) > 0) { pos += psize; + } } if (i != num_ports - 1) { - if (pos<sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf - pos), "%s", delimiter))> 0) + if (pos < sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf) - pos, "%s", delimiter))> 0) { pos += psize; + } } enqueue((LLQ *) ports, port_ele); // return TSPortEle to list
