[ https://issues.apache.org/jira/browse/KAFKA-14707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nelson Bighetti closed KAFKA-14707. ----------------------------------- > Possible read error in the Array type caused by insufficient remaining bytes > ---------------------------------------------------------------------------- > > Key: KAFKA-14707 > URL: https://issues.apache.org/jira/browse/KAFKA-14707 > Project: Kafka > Issue Type: Bug > Components: network > Reporter: Nelson Bighetti > Assignee: Nelson Bighetti > Priority: Minor > > {code:java} > if (size > buffer.remaining()) > throw new SchemaException("Error reading array of size " + size + ", only > " + buffer.remaining() + " bytes available"); {code} > Array type has the above code snippet which checks if there are enough bytes > in the buffer to read all the array elements. However, there is a unit > mismatch because `size` is the number of elements in the array, not the > number of bytes. Thus, even if the above check passes there still might be > not enough bytes remaining in the buffer. -- This message was sent by Atlassian Jira (v8.20.10#820010)