lucliu1108 commented on code in PR #23156:
URL: https://github.com/apache/kafka/pull/23156#discussion_r3809447648
##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorMetadata.java:
##########
@@ -52,9 +53,15 @@ public static ProcessorMetadata deserialize(final byte[]
metaDataBytes) {
final ByteBuffer buffer = ByteBuffer.wrap(metaDataBytes);
final int entrySize = buffer.getInt();
+ if (entrySize < 0 || entrySize > buffer.remaining() / (Integer.BYTES +
Long.BYTES)) {
+ throw new BufferUnderflowException();
+ }
final Map<String, Long> metadata = new HashMap<>(entrySize);
for (int i = 0; i < entrySize; i++) {
final int keySize = buffer.getInt();
+ if (keySize < 0 || keySize > buffer.remaining() - Long.BYTES) {
Review Comment:
I will leave it as it is now in case there are any boundary cases triggered.
--
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]