Skip to content

fix(ffi): borrow program_name in AuthenticodeSignature::new - #537

Open
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 1 commit into
masterfrom
ffi/authenticode-borrow-program-name
Open

irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 1 commit into
masterfrom
ffi/authenticode-borrow-program-name

Conversation

@irvingoujAtDevolution

@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

AuthenticodeSignature::new took program_name as Option<Box<RsString>>. Rust freed the string at the end of the call, but the C# RsString still owned the pointer and freed it again on dispose/finalize. Now it just borrows. The generated C# is the same either way, so it's a one-line change.

Bottom of the Diplomat devo.2 stack, see #536.

Tested: clippy clean, Devolutions.Picky.Tests 26/26 locally.

The bridge took `Option<Box<RsString>>`, so Rust freed the string at the
end of the call while the C# `RsString` still owned the same pointer and
freed it again on dispose/finalize. Take a reference instead. The
generated C# doesn't change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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

Development

Successfully merging this pull request may close these issues.

1 participant