arxhr007 opened a new pull request, #24099: URL: https://github.com/apache/kafka/pull/24099
Utils.getNullableArray(), Utils.toArray() and Utils.readBytes() accepted negative sizes — and, for the latter two, sizes larger than the available data — which surfaced as a NegativeArraySizeException or an inconsistent IndexOutOfBoundsException/BufferUnderflowException depending on the buffer type and code path. Validate the size up front so a doomed read consistently throws BufferUnderflowException, matching getNullableArray's existing oversize behaviour and the negative-size validation added to ByteBufferAccessor. Note this changes getNullableArray(-2) from NegativeArraySizeException to BufferUnderflowException (existing test updated). Generated-by: Devin <[email protected]> -- 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]
