Skip to content

Fix use-after-free of libdigidocpp Conf in example - #84

Open
aarmam wants to merge 1 commit into
mainfrom
NFC-193
Open

aarmam wants to merge 1 commit into
mainfrom
NFC-193

Conversation

@aarmam

@aarmam aarmam commented Nov 3, 2026

Copy link
Copy Markdown

Conf.init takes ownership of the native configuration object, but the C# wrapper kept ownership too. Once the GC finalized the local DigiDocConf wrapper, the native Conf was deleted and the next libdigidocpp call (e.g. Container.create) crashed with AccessViolationException. Hand the ownership over with Conf.transfer().

Signed-off-by: Mart Aarma mart.aarma@nortal.com

@aarmam
aarmam requested a review from mrts November 3, 2026 12:30
@aarmam aarmam self-assigned this Nov 3, 2026
@aarmam
aarmam changed the base branch from web-eid-mobile to main November 4, 2026 12:53
Conf.init takes ownership of the native configuration object, but the
C# wrapper kept ownership too. Once the GC finalized the local DigiDocConf
wrapper, the native Conf was deleted and the next libdigidocpp call
(e.g. Container.create) crashed with AccessViolationException. Hand the
ownership over with Conf.transfer().

Signed-off-by: Mart Aarma <mart.aarma@nortal.com>
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.

2 participants