Skip to content

wincng: sizeof(ssh2_ecdsa_ctx) (tidy up) - #2301

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

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

Conversation

@vszakats

Copy link
Copy Markdown
Member

To match rest of code.

Follow-up to 3e72343 #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

This PR is a small tidy-up to make WinCNG’s ECDSA context allocations use sizeof(ssh2_ecdsa_ctx) (matching the style used for other WinCNG crypto contexts), as a follow-up to the earlier ECDSA support work.

Changes:

  • Replace malloc(sizeof(struct wcng_ecdsa_ctx)) with malloc(sizeof(ssh2_ecdsa_ctx)) in three ECDSA allocation sites in the WinCNG backend.

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

Comment thread src/wincng.c
Comment on lines 2171 to 2175
goto cleanup;

*ec_ctx = malloc(sizeof(struct wcng_ecdsa_ctx));
*ec_ctx = malloc(sizeof(ssh2_ecdsa_ctx));
if(!*ec_ctx) {
result = LIBSSH2_ERROR_ALLOC;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeps.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

→ PR #2306

@vszakats vszakats closed this in 0c096d1 Jul 14, 2026
@vszakats
vszakats deleted the wcngsizeof branch July 14, 2026 09:57
vszakats added a commit that referenced this pull request Jul 14, 2026
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