You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Nelson Bighetti (Jira)" <ji...@apache.org> on 2023/02/13 04:29:00 UTC
[jira] [Assigned] (KAFKA-14707) Possible read error in the Array type caused by insufficient remaining bytes
[ https://issues.apache.org/jira/browse/KAFKA-14707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nelson Bighetti reassigned KAFKA-14707:
---------------------------------------
Assignee: Nelson Bighetti (was: Dongjin Lee)
> 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)