chia7712 commented on code in PR #22514:
URL: https://github.com/apache/kafka/pull/22514#discussion_r3382931790


##########
clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java:
##########
@@ -153,8 +153,8 @@ private List<Integer> deserializeNullIndexList(final 
DataInputStream dis, final
         if (nullIndexListSize < 0) {
             throw new SerializationException("Corrupted byte[]. The number of 
null list entries cannot be negative.");
         }
-        if (nullIndexListSize > length) {
-            throw new SerializationException("Corrupted byte[]. The number of 
null list entries cannot be larger than overall number of bytes.");
+        if (nullIndexListSize > length / primitiveSize) {

Review Comment:
   I meant if the inner type is variable-length (so `primitiveSize` is null), 
but we receive a corrupted payload with the `CONSTANT_SIZE` flag, it will cause 
an unexpected `NPE` here. Maybe we should convert it to a 
`SerializationException`?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to