agent-desktop/crates/ffi
Lahfir 107b902f86 fix: pin the AdAction ABI layout and bound FFI string and array inputs
AdDragParams is embedded by value in AdAction, so its 8-byte growth grew
the struct C callers pass to ad_execute_action with no size guard —
old-layout callers under-allocate and stack garbage becomes a live
drop_delay_ms. Adds AD_ACTION_SIZE / ad_action_size() with a layout pin,
matching the AdRefEntry pattern.

Also hardens the input boundary: C strings are decoded with a bounded
NUL scan (AD_MAX_STRING_BYTES, sized for CLI argv parity) so a missing
terminator cannot walk arbitrary memory, and the single coarse 1024
array cap becomes published per-field caps (AD_MAX_REF_STATES/ACTIONS/
PATH_DEPTH) with tests just over each limit.
2026-06-17 13:43:19 -07:00
..
examples refactor!: unify command execution contracts 2026-05-19 18:27:08 -07:00
include fix: pin the AdAction ABI layout and bound FFI string and array inputs 2026-06-17 13:43:19 -07:00
src fix: pin the AdAction ABI layout and bound FFI string and array inputs 2026-06-17 13:43:19 -07:00
tests fix: pin the AdAction ABI layout and bound FFI string and array inputs 2026-06-17 13:43:19 -07:00
build.rs chore: strip inline comments and enforce docstrings 2026-06-17 13:43:19 -07:00
Cargo.toml fix: harden reliability edge cases 2026-06-17 13:43:18 -07:00
cbindgen.toml refactor!: unify command execution contracts 2026-05-19 18:27:08 -07:00