Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix soundness issue with
container_of!
macro
Previously it was possible to trigger UB from safe code using the `container_of!` macro. For example: ```rust struct Foo { a: (), } fn main() { container_of!(core::ptr::null(), Foo, a); // UB } ``` Using `wrapping_offset` instead of `offset` makes the macro safe to call for any input. Signed-off-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com>
- Loading branch information