mirror of https://github.com/apache/cassandra
Conditionally read token in AuthSuccess#decode
Patch by Pierre Nogues; reviewed by Sam Tunnicliffe for CASSANDRA-9727
This commit is contained in:
parent
3623ea437e
commit
62714a9fed
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue