trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manj...@apache.org
Subject [3/5] git commit: [TS-2822] Adding check for zero length reads
Date Wed, 21 May 2014 18:56:50 GMT
[TS-2822] Adding check for zero length reads


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

Branch: refs/heads/master
Commit: 088d5fe08c85d60aa782de6c110d08f643ad2071
Parents: 92ad666
Author: Brian Geffon <briang@apache.org>
Authored: Wed May 21 11:25:41 2014 -0700
Committer: Manjesh Nilange <manjeshnilange@yahoo.com>
Committed: Wed May 21 11:52:57 2014 -0700

----------------------------------------------------------------------
 proxy/logstats.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/088d5fe0/proxy/logstats.cc
----------------------------------------------------------------------
diff --git a/proxy/logstats.cc b/proxy/logstats.cc
index 5d07df1..e594551 100644
--- a/proxy/logstats.cc
+++ b/proxy/logstats.cc
@@ -1752,7 +1752,7 @@ process_file(int in_fd, off_t offset, unsigned max_age)
     nread = 0;
     do {
       nread = read(in_fd, &buffer[sizeof(LogBufferHeader) + total_read], buffer_bytes
- total_read);
-      if (EOF == nread) { // just bail on error
+      if (EOF == nread || !nread) { // just bail on error
         Debug("logstats", "Read failed while reading log buffer, wanted %d bytes, nread=%d,
errno=%d", buffer_bytes - total_read, nread, errno);
         return 1;
       } else {


Mime
View raw message