Skip to content

Commit

Permalink
fix overflow in Bytes::slice
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn committed Oct 1, 2023
1 parent 3108e0d commit 81c7d37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl Bytes {

let begin = match range.start_bound() {
Bound::Included(&n) => n,
Bound::Excluded(&n) => n + 1,
Bound::Excluded(&n) => n.checked_add(1).expect("out of range"),
Bound::Unbounded => 0,
};

Expand Down

0 comments on commit 81c7d37

Please sign in to comment.