Skip to content

wincng: fix NULL deref on OOM in ssh2_ecdsa_sign() - #2305

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

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

Conversation

@vszakats

Copy link
Copy Markdown
Member

Reported by GitHub Code Quality

Follow-up to 3e72343 #1315

Reported by GitHub Code Quality

Follow-up to 3e72343 libssh2#1315

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 an out-of-memory (OOM) NULL dereference in the WinCNG ECDSA signing path (ssh2_ecdsa_sign()), aligning with the PR’s stated goal of addressing a Code Quality report and acting as a follow-up to the earlier ECDSA support work.

Changes:

  • Add an allocation failure check after SSH2_ALLOC() for the ECDSA signature buffer.
  • Return LIBSSH2_ERROR_ALLOC and jump to existing cleanup logic when allocation fails.

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

@vszakats vszakats closed this in fe34a06 Jul 14, 2026
@vszakats
vszakats deleted the wcngleakmore branch July 14, 2026 10:57
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