Skip to content

wolfSSL_X509_set_ext: fix memory handling#9907

Merged
douzzer merged 1 commit intowolfSSL:masterfrom
julek-wolfssl:fenrir/202
Mar 7, 2026
Merged

wolfSSL_X509_set_ext: fix memory handling#9907
douzzer merged 1 commit intowolfSSL:masterfrom
julek-wolfssl:fenrir/202

Conversation

@julek-wolfssl
Copy link
Member

@julek-wolfssl julek-wolfssl commented Mar 6, 2026

F-202

Copilot AI review requested due to automatic review settings March 6, 2026 11:12
@julek-wolfssl julek-wolfssl self-assigned this Mar 6, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes memory handling in wolfSSL_X509_set_ext() when resizing ext->obj->obj fails, ensuring the previous buffer is freed and the pointer state is consistent before error cleanup.

Changes:

  • Free the prior ext->obj->obj buffer when allocation/reallocation fails.
  • Always assign ext->obj->obj = tmp so the subsequent NULL-check path reliably triggers cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@julek-wolfssl julek-wolfssl added the For This Release Release version 5.9.0 label Mar 6, 2026
@douzzer douzzer added the Staged Staged for merge pending final test results and review label Mar 6, 2026
@douzzer douzzer merged commit 3b68026 into wolfSSL:master Mar 7, 2026
454 of 456 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For This Release Release version 5.9.0 Staged Staged for merge pending final test results and review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants