cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1084461 - in /cassandra/branches/cassandra-0.7: CHANGES.txt src/java/org/apache/cassandra/utils/ByteBufferUtil.java
Date Wed, 23 Mar 2011 02:30:05 GMT
Author: jbellis
Date: Wed Mar 23 02:30:05 2011
New Revision: 1084461

URL: http://svn.apache.org/viewvc?rev=1084461&view=rev
Log:
fix potential infinite loop in ByteBufferUtil.inputStream
patch by jbellis; reviewed by slebresne for CASSANDRA-2365

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/ByteBufferUtil.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1084461&r1=1084460&r2=1084461&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Wed Mar 23 02:30:05 2011
@@ -14,6 +14,7 @@
    the same threshold for TTL expiration (CASSANDRA-2349)
  * fix race when iterating CFs during add/drop (CASSANDRA-2350)
  * add ConsistencyLevel command to CLI (CASSANDRA-2354)
+ * fix potential infinite loop in ByteBufferUtil.inputStream (CASSANDRA-2365)
 
 
 0.7.4

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/ByteBufferUtil.java?rev=1084461&r1=1084460&r2=1084461&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/ByteBufferUtil.java
Wed Mar 23 02:30:05 2011
@@ -363,9 +363,11 @@ public class ByteBufferUtil
             @Override
             public int read(byte[] bytes, int off, int len) throws IOException
             {
+                if (!copy.hasRemaining())
+                    return -1;
+
                 len = Math.min(len, copy.remaining());
                 copy.get(bytes, off, len);
-
                 return len;
             }
 



Mime
View raw message