Skip to content

bug: guard empty receipt arrays across FFI #381

Description

@Andiveli

Problem

Empty receipt ID arrays may cross the Go/Rust FFI boundary as a null pointer with zero length while Rust unconditionally constructs a slice from the pointer.

Expected behavior

The ABI uses a coherent nil/zero pair for empty arrays, Rust decodes it without dereferencing a null pointer, and non-empty arrays retain their synchronous callback lifetime.

Actual behavior

The empty case is not explicitly guarded by the Rust decoder.

Relevant evidence

Affected code is in whatsrust/src/events.rs, whatsrust/lib/receipt_events.go, and its tests.

Acceptance criteria

  • Empty receipt arrays decode safely.
  • Non-empty arrays preserve existing allocation and callback behavior.
  • ABI layout remains unchanged.
  • Focused/full Go and Rust tests pass.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus:approvedIssue approved for implementation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions