Describe the bug
Hi team, we have a few range concepts in the codebase (ex, ex), which implicitly requires end offset is no less than start offset, but I don't think we check it.
As a result, we could potentially suffer underflow in certain places
-
|
Ok(BytesRange::new(start, Some(end - start + 1))) |
- and a few others
Steps to Reproduce
N/A
Expected Behavior
we check the input requirement at construction and propagate the error / panic as early as possible
Additional Context
No response
Are you willing to submit a PR to fix this bug?
Describe the bug
Hi team, we have a few range concepts in the codebase (ex, ex), which implicitly requires end offset is no less than start offset, but I don't think we check it.
As a result, we could potentially suffer underflow in certain places
opendal/core/core/src/raw/http_util/bytes_content_range.rs
Line 78 in 69114d2
opendal/core/core/src/raw/http_util/bytes_range.rs
Line 178 in 69114d2
Steps to Reproduce
N/A
Expected Behavior
we check the input requirement at construction and propagate the error / panic as early as possible
Additional Context
No response
Are you willing to submit a PR to fix this bug?