[ 
https://issues.apache.org/jira/browse/CASSANDRA-18505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17720580#comment-17720580
 ] 

Jon Meredith commented on CASSANDRA-18505:
------------------------------------------

Example stack trace
{code}
at 
org.apache.cassandra.db.marshal.ByteBufferAccessor.size(ByteBufferAccessor.java)
        at 
org.apache.cassandra.db.marshal.ByteBufferAccessor.size(ByteBufferAccessor.java)
        at 
org.apache.cassandra.serializers.UUIDSerializer.validate(UUIDSerializer.java)
        at 
org.apache.cassandra.serializers.SetSerializer.deserializeForNativeProtocol(SetSerializer.java)
        at org.apache.cassandra.cql3.Sets$Value.fromSerialized(Sets.java)
        at org.apache.cassandra.cql3.Sets$Marker.bind(Sets.java)
        at org.apache.cassandra.cql3.Sets$Setter.execute(Sets.java)
        at 
org.apache.cassandra.cql3.statements.UpdateStatement.addUpdateForKey(UpdateStatement.java)
        at 
org.apache.cassandra.cql3.statements.CQL3CasRequest$RowUpdate.applyUpdates(CQL3CasRequest.java)
        at 
org.apache.cassandra.cql3.statements.CQL3CasRequest.makeUpdates(CQL3CasRequest.java)
        at 
org.apache.cassandra.service.StorageProxy.lambda$cas$3(StorageProxy.java)
        at org.apache.cassandra.service.StorageProxy.doPaxos(StorageProxy.java)
        at org.apache.cassandra.service.StorageProxy.cas(StorageProxy.java)
{code}

> NPE when deserializing malformed collections from client
> --------------------------------------------------------
>
>                 Key: CASSANDRA-18505
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18505
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jon Meredith
>            Assignee: Jon Meredith
>            Priority: Normal
>
> When deserializing collections sent from the client, if an element in the 
> collection is incorrectly serialized, Collections.getValue can return null if 
> the length of the element is negative.  Currently this isn't detected and 
> serialization continues, calling validate and throwing an NPE in serializers 
> that don't handle null value buffers.
> Detect the malformed input and throw a better MarshalException so it will be 
> converted to an InvalidRequestException for the client.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to