hsivonen / hsivonen/encoding_c
Missing null checks and panic handlers in extern functions
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 9
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
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_nullto check that pointers are not null before accessing them - Use
catch_unwindto stop panics from unwinding across the FFI
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the FFI bindings and their exported extern functions, then review pointer accesses and panic boundaries. Done means the bindings check pointers with is_null and prevent panics from unwinding across the FFI with catch_unwind, without relying only on the existing documentation warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, rust
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100