Field is_ok
should be private for DiplomatResult
#270
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Extra attention is needed
techdebt
Internal issue with minimal external impact
Since
is_ok
is public, it is trivial to get UB in Safe Rust using Diplomat (without any FFI) by writingThis will attempt to call
Box::drop
on the value32
, leading to a segmentation fault.One can retain about equivalent API power (since
is_ok
is the only public field) by having a safe getter returning the value and an unsafe getter returning a mutable reference to the value.The text was updated successfully, but these errors were encountered: