Skip to content

Fix minor issues and add a regress test#971

Open
yosuke-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
yosuke-wolfssl:f_fix
Open

Fix minor issues and add a regress test#971
yosuke-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
yosuke-wolfssl:f_fix

Conversation

@yosuke-wolfssl
Copy link
Copy Markdown
Contributor

@yosuke-wolfssl yosuke-wolfssl commented May 12, 2026

This PR fixes minor issues addressed by static analysis.

  • Fix IdentifyAsn1Key to free key on failure path
  • Fix control flow in SendKexDhReply
  • Remove dead code in SFTP_CreateLongName
  • Fix resource management in wolfSSH_SFTP_RecvFSTAT
  • Fix resource management in wolfSSH_SFTP_RecvRead (Windows path)
  • Add a regress test for IdentifyAsn1Key

Issues: F-861, F-862, F-1273, F-1680 and F-1681

@yosuke-wolfssl yosuke-wolfssl self-assigned this May 12, 2026
Copilot AI review requested due to automatic review settings May 12, 2026 04:10
Copy link
Copy Markdown
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

Note

Copilot was unable to run its full agentic suite in this review.

This PR addresses several static-analysis findings around resource cleanup and control flow, and adds a regression unit test for IdentifyAsn1Key.

Changes:

  • Fix key cleanup on ASN.1 decode failure paths in IdentifyAsn1Key.
  • Fix KEX DH reply control flow and tighten SFTP buffer/resource management.
  • Add a regression unit test with embedded DER test keys for IdentifyAsn1Key.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/unit.c Adds self-contained DER fixtures and a regression test covering IdentifyAsn1Key failure-path cleanup.
src/wolfsftp.c Removes dead free and adds frees on early-return error paths to avoid leaks.
src/internal.c Ensures key objects are freed on decode failures and corrects Curve25519/ECDH control flow.

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

Comment thread src/wolfsftp.c
Comment thread tests/unit.c Outdated
Comment thread tests/unit.c Outdated
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.

4 participants