leiysky commented on code in PR #8931:
URL: https://github.com/apache/arrow-rs/pull/8931#discussion_r2567057533
##########
arrow-ipc/src/reader.rs:
##########
@@ -569,7 +569,13 @@ impl<'a> RecordBatchDecoder<'a> {
}
fn next_buffer(&mut self) -> Result<Buffer, ArrowError> {
- read_buffer(self.buffers.next().unwrap(), self.data, self.compression)
+ read_buffer(
+ self.buffers.next().ok_or_else(|| {
Review Comment:
It will happen if metadata claims more buffers than it supplied.
For example, in our case, a user constructed a primitive integer array
without validity mask(for some unknown reason). Therefore only one buffer is
encoded while `RecordBatchDecoder` requires two at here, which will panic
during the second invocation of `next_buffer`.
https://github.com/apache/arrow-rs/blob/1c90efe717c1a2f99a0a97d6e9c93cd913eaca3c/arrow-ipc/src/reader.rs#L240
It's not convenient to construct such kind of corrupted input for testing,
do you have any suggestion?
--
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]