lucasbru commented on code in PR #22465:
URL: https://github.com/apache/kafka/pull/22465#discussion_r3355009913


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/AssignmentInfo.java:
##########
@@ -385,45 +386,65 @@ public static AssignmentInfo decode(final ByteBuffer 
data) {
     }
 
     private static void decodeActiveTasks(final AssignmentInfo assignmentInfo,
-                                          final DataInputStream in) throws 
IOException {
+                                          final DataInputStream in,
+                                          final int length) throws IOException 
{
         final int count = in.readInt();
+        if (count > length) {

Review Comment:
   `count > length` won't catch a negative count. On corruption `count` could 
be negative, which falls through to `new ArrayList<>(count)` and throws 
IllegalArgumentException, escaping decode() uncaught (only IOException gets 
wrapped into TaskAssignmentException). Maybe `count < 0 || count > length` so 
it consistently surfaces as TaskAssignmentException?



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