You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2014/04/12 21:36:38 UTC

[1/2] git commit: TS-898: avoid passing -1 to close (2) in traffic_cop

Repository: trafficserver
Updated Branches:
  refs/heads/master ba6d0c760 -> f4aa7b220


TS-898: avoid passing -1 to close (2) in traffic_cop

This is harmless, but also trivial to fix. Coverity #1021900.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f4aa7b22
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f4aa7b22
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f4aa7b22

Branch: refs/heads/master
Commit: f4aa7b22055f9eea4b524fcb5462915e792d627c
Parents: c945682
Author: James Peach <jp...@apache.org>
Authored: Sat Apr 12 12:30:25 2014 -0700
Committer: James Peach <jp...@apache.org>
Committed: Sat Apr 12 12:36:27 2014 -0700

----------------------------------------------------------------------
 CHANGES                        | 2 ++
 cmd/traffic_cop/traffic_cop.cc | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f4aa7b22/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 8c6e195..4970f8e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.0.0
 
+  *) [TS-898] Avoid passing -1 to close (2) in traffic_cop.
+
   *) [TS-898] Fix minor regex_remap parsing bug.
 
   *) [TS-2711] Include Lua JIT as a Submodule.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f4aa7b22/cmd/traffic_cop/traffic_cop.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_cop/traffic_cop.cc b/cmd/traffic_cop/traffic_cop.cc
index ee80716..50615f2 100644
--- a/cmd/traffic_cop/traffic_cop.cc
+++ b/cmd/traffic_cop/traffic_cop.cc
@@ -737,7 +737,9 @@ spawn_manager()
   } else if (err == -1) {
     cop_log(COP_FATAL, "unable to fork [%d '%s']\n", errno, strerror(errno));
     exit(1);
-  } else {
+  }
+
+  if (log_fd >= 0) {
     close(log_fd);
   }
 


[2/2] git commit: TS-898: fix minor regex_remap parsing bug

Posted by jp...@apache.org.
TS-898: fix minor regex_remap parsing bug

If the line contains only whitespace, don't index into the string.

Coverity #1021882


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c945682e
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c945682e
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c945682e

Branch: refs/heads/master
Commit: c945682e7c746b3036b64527b03b886a2b23dc14
Parents: ba6d0c7
Author: James Peach <jp...@apache.org>
Authored: Sat Apr 12 12:23:01 2014 -0700
Committer: James Peach <jp...@apache.org>
Committed: Sat Apr 12 12:36:27 2014 -0700

----------------------------------------------------------------------
 CHANGES                            |  2 ++
 plugins/regex_remap/regex_remap.cc | 10 ++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c945682e/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index a276d93..8c6e195 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.0.0
 
+  *) [TS-898] Fix minor regex_remap parsing bug.
+
   *) [TS-2711] Include Lua JIT as a Submodule.
 
   *) [TS-898] Ensure the cache span probe always closes file descriptors.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c945682e/plugins/regex_remap/regex_remap.cc
----------------------------------------------------------------------
diff --git a/plugins/regex_remap/regex_remap.cc b/plugins/regex_remap/regex_remap.cc
index 416f90c..efd3d24 100644
--- a/plugins/regex_remap/regex_remap.cc
+++ b/plugins/regex_remap/regex_remap.cc
@@ -733,12 +733,14 @@ TSRemapNewInstance(int argc, char* argv[], void** ih, char* /* errbuf ATS_UNUSED
     if (line.empty()) {
       continue;
     }
-    pos1 = line.find_first_not_of(" \t\n");
-    if (line[pos1] == '#') {
-      continue;  // Skip comment lines
-    }
 
+    pos1 = line.find_first_not_of(" \t\n");
     if (pos1 != std::string::npos) {
+
+      if (line[pos1] == '#') {
+        continue;  // Skip comment lines
+      }
+
       pos2 = line.find_first_of(" \t\n", pos1);
       if (pos2 != std::string::npos) {
         regex = line.substr(pos1, pos2-pos1);