Skip to content

Commit

Permalink
object_store careful range slicing
Browse files Browse the repository at this point in the history
Ranges requested beyond the length of the resource can no longer
cause panics in the `coalesce_ranges` function.
  • Loading branch information
clbarnes committed Dec 12, 2023
1 parent 8aa55dd commit ee91fe7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion object_store/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ where

let start = range.start - fetch_range.start;
let end = range.end - fetch_range.start;
fetch_bytes.slice(start..end)
fetch_bytes.slice(start..end.min(fetch_bytes.len()))
})
.collect())
}
Expand Down

0 comments on commit ee91fe7

Please sign in to comment.