rich7420 opened a new issue, #6782: URL: https://github.com/apache/opendal/issues/6782
### Describe the bug The `fetch` method uses `partition_point` to find the corresponding merged range, but doesn't check if `partition_point` returns 0. When `partition_point` returns 0, `0 - 1` causes integer underflow (becomes `usize::MAX`), leading to out-of-bounds access and panic. https://github.com/apache/opendal/blob/fc5725a2a007fbf8e322d05596e72f5a787c7ce4/core/src/types/read/reader.rs#L179 ### Steps to Reproduce none ### Expected Behavior Check if `partition_point` returns 0 before subtracting 1, and validate that each range is within the merged ranges. ### Additional Context _No response_ ### Are you willing to submit a PR to fix this bug? - [x] Yes, I would like to submit a PR. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
