encoding_c
encoding_c copied to clipboard
Missing null checks and panic handlers in extern functions
The FFI bindings in this library are missing null checks and panic handlers that would avoid undefined behavior. The documentation does warn users about conditions that will trigger undefined behavior, but the library could provide a safer interface by avoiding those sources of undefined behavior.
In particular, the bindings could:
- Use
is_null
to check that pointers are not null before accessing them - Use
catch_unwind
to stop panics from unwinding across the FFI