fallintoplace opened a new pull request, #7807:
URL: https://github.com/apache/opendal/pull/7807
## Summary
- Handle empty C `opendal_bytes` without constructing a Rust slice from a
null pointer.
- Return an OpenDAL error when non-empty input buffers have null data.
- Clarify C byte buffer ownership docs and add focused coverage for operator
and writer writes.
## Why
C callers can reasonably pass `{ .data = NULL, .len = 0, .capacity = 0 }`
for an empty buffer. Rust still requires `slice::from_raw_parts` to receive a
non-null, aligned pointer even when the length is zero, so the old conversion
could invoke undefined behavior.
## Tests
- `cargo clippy -- -D warnings`
- `cmake -S . -B build -DTEST_ENABLE_ASAN=ON
-DFEATURES=opendal/services-memory && cmake --build build -j4 && ./build/tests`
- `cargo build --features="opendal/services-memory" && make -C tests clean
all && OPENDAL_TEST=memory make -C tests behavior_test`
--
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]