cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [03/10] cassandra git commit: Conditionally read token in AuthSuccess#decode
Date Mon, 06 Jul 2015 14:17:09 GMT
Conditionally read token in AuthSuccess#decode

Patch by Pierre Nogues; reviewed by Sam Tunnicliffe for CASSANDRA-9727


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

Branch: refs/heads/cassandra-2.2
Commit: 62714a9fed4edfbff49543319c28e8bedab0a0d3
Parents: 3623ea4
Author: Sam Tunnicliffe <sam@beobal.com>
Authored: Mon Jul 6 10:55:59 2015 +0100
Committer: Sam Tunnicliffe <sam@beobal.com>
Committed: Mon Jul 6 14:53:27 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                  | 1 +
 .../org/apache/cassandra/transport/messages/AuthSuccess.java | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/62714a9f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index e453958..ca4d4b5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.17
+ * Avoid NPE in AuthSuccess#decode (CASSANDRA-9727)
  * Add listen_address to system.local (CASSANDRA-9603)
  * Bug fixes to resultset metadata construction (CASSANDRA-9636)
  * Fix setting 'durable_writes' in ALTER KEYSPACE (CASSANDRA-9560)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/62714a9f/src/java/org/apache/cassandra/transport/messages/AuthSuccess.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/transport/messages/AuthSuccess.java b/src/java/org/apache/cassandra/transport/messages/AuthSuccess.java
index 2595f28..20bbed4 100644
--- a/src/java/org/apache/cassandra/transport/messages/AuthSuccess.java
+++ b/src/java/org/apache/cassandra/transport/messages/AuthSuccess.java
@@ -36,8 +36,12 @@ public class AuthSuccess extends Message.Response
         public AuthSuccess decode(ChannelBuffer body, int version)
         {
             ByteBuffer b = CBUtil.readValue(body);
-            byte[] token = new byte[b.remaining()];
-            b.get(token);
+            byte[] token = null;
+            if (b != null)
+            {
+                token = new byte[b.remaining()];
+                b.get(token);
+            }
             return new AuthSuccess(token);
         }
 


Mime
View raw message