Skip to content

Fix double-free of she2 in she_test()#10283

Merged
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
night1rider:SHE-test-double-free-fix
Apr 23, 2026
Merged

Fix double-free of she2 in she_test()#10283
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
night1rider:SHE-test-double-free-fix

Conversation

@night1rider
Copy link
Copy Markdown
Contributor

Summary

she_test() in wolfcrypt/test/test.c frees she2 twice on several code paths. WC_FREE_VAR does not null its argument, so the exit-label cleanup at exit_SHE_Test: re-frees the same pointer that was already freed mid-test.

Fix

Set she2 = NULL after every intermediate WC_FREE_VAR(she2, HEAP_HINT) so the subsequent free at exit_SHE_Test: sees NULL and becomes a no-op. Three sites updated.

@night1rider night1rider force-pushed the SHE-test-double-free-fix branch from 74169f4 to d673b62 Compare April 22, 2026 23:33
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

MemBrowse Memory Report

No memory changes detected for:

@night1rider night1rider self-assigned this Apr 22, 2026
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #10283

No scan targets match the changed files in this PR. Review skipped.

@JacobBarthelmeh JacobBarthelmeh merged commit d9beec2 into wolfSSL:master Apr 23, 2026
449 of 450 checks passed
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.

4 participants