Commit a6c9776
committed
fix: handle
`Range: bytes=-0` would pass the `checked_sub` guard (since
`size - 0 = size`), then compute `start = size, end = size - 1`,
causing `Bound::new` to fail and the `unwrap()` to panic.
Validate that the computed start position is within bounds by using
`is_some_and(|start| start < size)`.Suffix(0) as unsatisfiable instead of panicking1 parent f4d07d4 commit a6c9776
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
0 commit comments