Repository: trafficserver Updated Branches: refs/heads/master 558243240 -> 340d9cb0e
TS-3887: Use snprintf() instead of sprintf() in UrlPrintHack Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/98ab9075 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/98ab9075 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/98ab9075 Branch: refs/heads/master Commit: 98ab90758e3f28a71beb011afb3e83260e77289d Parents: 5582432 Author: Masa Sekimura <[email protected]> Authored: Wed Sep 2 21:02:14 2015 -0600 Committer: Phil Sorber <[email protected]> Committed: Thu Sep 3 09:22:03 2015 -0600 ---------------------------------------------------------------------- proxy/hdrs/HTTP.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/98ab9075/proxy/hdrs/HTTP.cc ---------------------------------------------------------------------- diff --git a/proxy/hdrs/HTTP.cc b/proxy/hdrs/HTTP.cc index 3a3d067..aa0040b 100644 --- a/proxy/hdrs/HTTP.cc +++ b/proxy/hdrs/HTTP.cc @@ -1607,7 +1607,7 @@ class UrlPrintHack if (0 == hdr->m_url_cached.port_get_raw() && hdr->m_port_in_header) { ink_assert(0 == ui->m_ptr_port); // shouldn't be set if not in URL. ui->m_ptr_port = m_port_buff; - ui->m_len_port = sprintf(m_port_buff, "%.5d", hdr->m_port); + ui->m_len_port = snprintf(m_port_buff, sizeof(m_port_buff), "%d", hdr->m_port); m_port_modified_p = true; } else { m_port_modified_p = false; @@ -1653,7 +1653,7 @@ class UrlPrintHack HTTPHdr *m_hdr; ///@} /// Temporary buffer for port data. - char m_port_buff[6]; + char m_port_buff[32]; }; char *
