You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "dentiny (via GitHub)" <gi...@apache.org> on 2026/03/24 08:00:19 UTC
[I] bug: fetch with empty range panics [opendal]
dentiny opened a new issue, #7285:
URL: https://github.com/apache/opendal/issues/7285
### Describe the bug
Hi team, I met a panic in canary test. Checking the code, I think we didn't check the emptiness for the given range s to fetch, so we could suffer out-of-bound access.
https://github.com/apache/opendal/blob/0f45d6aff459c4cddbbd8432027455801115db49/core/core/src/types/read/reader.rs#L197
### Steps to Reproduce
```rust
#[tokio::test]
async fn test_fetch_empty_ranges() -> Result<()> {
let op = Operator::new(services::Memory::default()).unwrap().finish();
let path = "test_file";
let content = gen_fixed_bytes(1024);
op.write(path, content.clone())
.await
.expect("write must succeed");
let reader = op.reader(path).await.unwrap();
let result = reader.fetch(vec![]).await.expect("fetch with empty ranges must not panic");
assert!(result.is_empty());
Ok(())
}
```
### Expected Behavior
When empty ranges given, we should return an empty vector, instead of panic.
### 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: commits-unsubscribe@opendal.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: fetch with empty range panics [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo closed issue #7285: bug: fetch with empty range panics
URL: https://github.com/apache/opendal/issues/7285
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org