Conditionally read token in AuthSuccess#decode

Patch by Pierre Nogues; reviewed by Sam Tunnicliffe for CASSANDRA-9727
This commit is contained in:
Sam Tunnicliffe 2015-07-06 10:55:59 +01:00
parent 3623ea437e
commit 62714a9fed
2 changed files with 7 additions and 2 deletions

View File

@ -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)

View File

@ -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);
}