alamb commented on code in PR #12340:
URL: https://github.com/apache/arrow-rs/pull/12340#discussion_r4645772635
##########
arrow-csv/src/reader/records.rs:
##########
@@ -84,8 +84,26 @@ impl RecordDecoder {
}
// Reserve sufficient capacity in offsets
- self.offsets
- .resize(self.offsets_len + to_read * self.num_columns, 0);
+ let offsets_capacity = to_read
+ .checked_mul(self.num_columns)
Review Comment:
In my mind, if the file is maliciously altered or doesn't conform to the
spec there is no well defined answer and it is ok to
1. Return an error
2. Return some data (unspecified)
3. Panic
Ideally it wouldn't panic and it would return a nice error message, but
those aren't absolute necessities in my mind, especially for wacky corrupted
input
--
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]