Skip to content

openssl: fix leaking key buffer on error in ossl_ecdsa_sk_openssh_priv_to_pubkey() - #2293

Closed
vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:osslleak
Closed

vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:osslleak

Conversation

@vszakats

Copy link
Copy Markdown
Member

Follow-up to ed439a2 #698

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes a memory leak in the OpenSSL backend when converting OpenSSH ECDSA-SK private keys to public keys, specifically in the error/cleanup path of ossl_ecdsa_sk_openssh_priv_to_pubkey().

Changes:

  • Initialize the temporary key buffer pointer to NULL to make cleanup safe.
  • Free the allocated key buffer on the fail: path to prevent leaks.

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

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