trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject git commit: TS-1475: Bad value for parameter fix.
Date Tue, 30 Sep 2014 19:31:35 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master b6753338f -> 8df4d0b18


TS-1475: Bad value for parameter fix.


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

Branch: refs/heads/master
Commit: 8df4d0b18d0e2794ec620798dcfaf5721ac3ca4d
Parents: b675333
Author: Alan M. Carroll <amc@network-geographics.com>
Authored: Tue Sep 30 14:31:09 2014 -0500
Committer: Alan M. Carroll <amc@network-geographics.com>
Committed: Tue Sep 30 14:31:09 2014 -0500

----------------------------------------------------------------------
 lib/ts/IpMapConf.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8df4d0b1/lib/ts/IpMapConf.cc
----------------------------------------------------------------------
diff --git a/lib/ts/IpMapConf.cc b/lib/ts/IpMapConf.cc
index a331610..bb54ae5 100644
--- a/lib/ts/IpMapConf.cc
+++ b/lib/ts/IpMapConf.cc
@@ -76,7 +76,10 @@ char *
 Load_IpMap_From_File(IpMap* map, int fd, const char *key_str)
 {
   char* zret = 0;
-  FILE* f = fdopen(dup(fd), "r"); // dup so we don't close the original fd.
+  int fd2 = dup(fd); // dup to avoid closing the original file.
+  FILE* f = NULL;
+
+  if (fd2 >= 0) f = fdopen(fd2, "r");
 
   if (f != NULL) {
     zret = Load_IpMap_From_File(map, f, key_str);


Mime
View raw message