lucliu1108 commented on code in PR #23158:
URL: https://github.com/apache/kafka/pull/23158#discussion_r3809640574


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorRecordContext.java:
##########
@@ -195,6 +196,9 @@ public static ProcessorRecordContext deserialize(final 
ByteBuffer buffer) {
         if (headerCount == -1) { // keep for backward compatibility
             headers = new RecordHeaders();
         } else {
+            if (headerCount < 0 || headerCount > buffer.remaining() / 4) {

Review Comment:
   Yes it should be `2 * Integer.BYTES`, I somehow only considered the key. 
Corrected that, and also change the `maxPlausibleHeaderCount` in test 
`shouldRejectHeaderCountLargerThanRemainingBuffer` to also divide by 8.



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