You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "smiklosovic (via GitHub)" <gi...@apache.org> on 2023/05/08 17:15:47 UTC
[GitHub] [cassandra] smiklosovic commented on a diff in pull request #2312: NPE when deserializing malformed collections from client
smiklosovic commented on code in PR #2312:
URL: https://github.com/apache/cassandra/pull/2312#discussion_r1187687426
##########
src/java/org/apache/cassandra/serializers/ListSerializer.java:
##########
@@ -104,6 +106,8 @@ public <V> List<T> deserializeForNativeProtocol(V input, ValueAccessor<V> access
{
// We can have nulls in lists that are used for IN values
V databb = readValue(input, accessor, offset, version);
+ if (databb == null)
+ throw new MarshalException("Not enough bytes to read value in list");
offset += sizeOfValue(databb, accessor, version);
if (databb != null)
Review Comment:
Why not to throw that exception from that method? We do not need to throw it explicitly everywhere then.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org