Skip to content

fix(fspy): allocate a slot for the NULL terminator in execl with 32+ arguments - #865

Open
tlq5l wants to merge 1 commit into
voidzero-dev:mainfrom
tlq5l:fix/fspy-execl-argv-terminator
Open

tlq5l wants to merge 1 commit into
voidzero-dev:mainfrom
tlq5l:fix/fspy-execl-argv-terminator

Conversation

@tlq5l

@tlq5l tlq5l commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #699

Motivation

with_argv builds the argv array for execl, execlp and execle. With 32 or more arguments it takes the heap branch, which allocated exactly argc slots and then wrote the closing NULL at out[argc]. That index panicked inside an extern "C" interposer, which aborted the traced process.

Change

  • Allocate argc + 1 slots in the heap branch, so the NULL terminator has room.
  • New test crates/fspy/tests/execl_many_args.rs calls execl with 40 arguments under fspy and checks the child exits normally. It aborts without the fix.
  • Changelog entry under Unreleased.

…arguments

Fixes voidzero-dev#699

The heap branch of `with_argv` allocated exactly `argc` slots, then wrote
the closing NULL at `out[argc]`. That panicked inside an `extern "C"`
interposer, which aborted the traced process. Allocate `argc + 1` slots.

Co-authored-by: DeepSeek V4.1 Flash <noreply@deepseek.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@tlq5l
tlq5l force-pushed the fix/fspy-execl-argv-terminator branch from 6e4f8df to 81b6f34 Compare October 19, 2026 22:27

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

fspy_preload_unix: execl with 32+ arguments aborts on an out-of-bounds NULL terminator write

1 participant