You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/02/21 12:51:53 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3743: Use Typed Buffers in Arrays (#1811) (#1176)

tustvold commented on code in PR #3743:
URL: https://github.com/apache/arrow-rs/pull/3743#discussion_r1113008885


##########
arrow-buffer/src/buffer/immutable.rs:
##########
@@ -162,12 +183,15 @@ impl Buffer {
     /// Panics iff `(offset + length)` is larger than the existing length.
     pub fn slice_with_length(&self, offset: usize, length: usize) -> Self {
         assert!(
-            offset + length <= self.len(),
+            offset.saturating_add(length) <= self.length,

Review Comment:
   This was actually a bug, now covered by https://github.com/apache/arrow-rs/pull/3743/files#diff-24dc7184f64fe7a484db137ef61b2ec31090bb959fc9013beefea7865cdfea59R628



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org