You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by zwoop <gi...@git.apache.org> on 2016/11/23 21:29:35 UTC

[GitHub] trafficserver pull request #1234: TS-5063: Fixes coverity warnings and clean...

GitHub user zwoop opened a pull request:

    https://github.com/apache/trafficserver/pull/1234

    TS-5063: Fixes coverity warnings and cleans up the temp string

    The Vec<char> seems overkill here, and makes things less nice when
    managing the intermediary strings. The new code has issues with being
    potentially used without initialization.
    
    CID 1365975, 1365974

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zwoop/trafficserver TS-5063

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafficserver/pull/1234.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1234
    
----
commit 81fa683077dea2a21bf69192af3aa547901a2de6
Author: Leif Hedstrom <zw...@apache.org>
Date:   2016-11-23T21:23:00Z

    TS-5063: Fixes coverity warnings and cleans up the temp string
    
    The Vec<char> seems overkill here, and makes things less nice when
    managing the intermediary strings. The new code has issues with being
    potentially used without initialization.
    
    CID 1365975, 1365974

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #1234: TS-5063: Fixes coverity warnings and clean...

Posted by zwoop <gi...@git.apache.org>.
Github user zwoop commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/1234#discussion_r89405035
  
    --- 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 --
    
    Thanks!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #1234: TS-5063: Fixes coverity warnings and clean...

Posted by zwoop <gi...@git.apache.org>.
Github user zwoop closed the pull request at:

    https://github.com/apache/trafficserver/pull/1234


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request #1234: TS-5063: Fixes coverity warnings and clean...

Posted by jpeach <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1234: TS-5063: Fixes coverity warnings and cleans up th...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/1234
  
    Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/1106/ for details.
     



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1234: TS-5063: Fixes coverity warnings and cleans up th...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/1234
  
    FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1212/ for details.
     



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1234: TS-5063: Fixes coverity warnings and cleans up th...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/1234
  
    Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/1109/ for details.
     



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1234: TS-5063: Fixes coverity warnings and cleans up th...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/1234
  
    Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/1105/ for details.
     



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1234: TS-5063: Fixes coverity warnings and cleans up th...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/1234
  
    FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1216/ for details.
     



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1234: TS-5063: Fixes coverity warnings and cleans up th...

Posted by atsci <gi...@git.apache.org>.
Github user atsci commented on the issue:

    https://github.com/apache/trafficserver/pull/1234
  
    FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1213/ for details.
     



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver issue #1234: TS-5063: Fixes coverity warnings and cleans up th...

Posted by zwoop <gi...@git.apache.org>.
Github user zwoop commented on the issue:

    https://github.com/apache/trafficserver/pull/1234
  
    I think this will clear the clang analyzer errors too.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---