Github user jpeach commented on a diff in the pull request:
https://github.com/apache/trafficserver/pull/1234#discussion_r89402683
--- Diff: mgmt/LocalManager.cc ---
@@ -950,29 +949,27 @@ LocalManager::startProxy(const char *onetime_options)
if (open_ports_p) {
char portbuf[128];
bool need_comma_p = false;
- real_proxy_options.append(" --httpport ", strlen(" --httpport "));
+
+ ink_strlcat(real_proxy_options, " --httpport ", strlen(" --httpport
"));
for (int i = 0, limit = m_proxy_ports.length(); i < limit; ++i) {
HttpProxyPort &p = m_proxy_ports[i];
if (ts::NO_FD != p.m_fd) {
if (need_comma_p) {
- real_proxy_options.append(',');
+ ink_strlcat(real_proxy_options, ",", 1);
}
need_comma_p = true;
p.print(portbuf, sizeof(portbuf));
- real_proxy_options.append((const char *)portbuf,
strlen(portbuf));
+ ink_strlcat(real_proxy_options, (const char *)portbuf,
strlen(portbuf));
--- End diff --
The size argument to
[strlcat](https://www.freebsd.org/cgi/man.cgi?query=strlcat&sektion=3&apropos=0&manpath=FreeBSD+6.2-RELEASE)
is the size of the destination buffer. All these usages are passing the wrong
size.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---