Skip to content

wincng: fix NULL deref on OOM in ssh2_ecdsa_verify() - #2191

Closed
vszakats wants to merge 2 commits into
libssh2:masterfrom
vszakats:wcng3
Closed

vszakats wants to merge 2 commits into
libssh2:masterfrom
vszakats:wcng3

Conversation

@vszakats

@vszakats vszakats commented Jul 3, 2026 •

Copy link
Copy Markdown
Member

Also return an error code on wcng_hash() fail.

Reported by GitHub Code Quality and Copilot

Follow-up to 3e72343 #1315

Reported by GitHub Code Quality
@vszakats vszakats changed the title wincng: handle OOM in ssh2_ecdsa_verify() wincng: fix NULL deref on OOM in ssh2_ecdsa_verify() Jul 3, 2026
@vszakats
vszakats requested a review from Copilot July 3, 2026 09:27

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 NULL dereference in the WinCNG ECDSA verification path (ssh2_ecdsa_verify()), improving robustness of the Windows CNG crypto backend.

Changes:

  • Add an OOM check after allocating the hash buffer in ssh2_ecdsa_verify(), returning LIBSSH2_ERROR_ALLOC on failure.

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

Comment thread src/wincng.c Resolved

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@vszakats vszakats closed this in 4504119 Jul 3, 2026
@vszakats
vszakats deleted the wcng3 branch July 3, 2026 10:52
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