hsivonen / hsivonen/encoding_c

Missing null checks and panic handlers in extern functions

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

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:

  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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.