zenoh
zenoh copied to clipboard
[Bug] Undefined Behavior in `zenoh_config::Notifier`
Describe the bug
The function mutable
found on https://github.com/eclipse-zenoh/zenoh/blob/45b7ad70bddf45dfcdcae80e9c9a7680c70ac289/commons/zenoh-config/src/lib.rs#L500 transmutes a reference to a mutable reference, which is defined in the Rust language documentation as always being Undefined Behavior (since it breaks LLVM's pointer aliasing rules).
Is it possible to refactor the code to use an UnsafeCell
instead?
To reproduce
N/A - found via looking through code
System info
Zenoh Commit: 45b7ad70bddf45dfcdcae80e9c9a7680c70ac289