scovich commented on code in PR #9819:
URL: https://github.com/apache/arrow-rs/pull/9819#discussion_r3148383330
##########
arrow-buffer/src/buffer/mutable.rs:
##########
@@ -284,9 +284,15 @@ impl MutableBuffer {
}
let bytes_to_repeat = size_of_val(slice_to_repeat);
+ let repeated_bytes = repeat_count
+ .checked_mul(bytes_to_repeat)
+ .expect("repeated slice byte length overflow");
+ self.len
+ .checked_add(repeated_bytes)
+ .expect("mutable buffer length overflow");
Review Comment:
I don't love introducing panics (tho clearly that's better than UB).
Any possibility to make this API more robust?
--
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]