Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing null checks and panic handlers in extern functions #7

Open
marco-vassena opened this issue Oct 31, 2023 · 0 comments
Open

Missing null checks and panic handlers in extern functions #7

marco-vassena opened this issue Oct 31, 2023 · 0 comments

Comments

@marco-vassena
Copy link

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:

  1. Use is_null to check that pointers are not null before accessing them
  2. Use catch_unwind to stop panics from unwinding across the FFI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant