Skip to content

libssh2: fix error handling on quote errors#20883

Closed
bagder wants to merge 4 commits intomasterfrom
bagder/libssh2-return
Closed

libssh2: fix error handling on quote errors#20883
bagder wants to merge 4 commits intomasterfrom
bagder/libssh2-return

Conversation

@bagder
Copy link
Copy Markdown
Member

@bagder bagder commented Mar 11, 2026

Previously it lacked the actual return.

Reported-by: m777m0 on hackerone

Follow-up to 578706a

Previously it lacked the actual return.

Reported-by: m777m0 on hackerone

Follow-up to 578706a
@bagder bagder marked this pull request as ready for review March 11, 2026 07:38
@bagder
Copy link
Copy Markdown
Member Author

bagder commented Mar 11, 2026

@aisle-analyzer augment review

@aisle-research-bot
Copy link
Copy Markdown

aisle-research-bot bot commented Mar 11, 2026

🔒 Aisle Security Analysis

✅ We scanned this PR and did not find any security vulnerabilities.

Aisle supplements but does not replace security review.


Analyzed PR: #20883 at commit 74a4702

Last updated on: 2026-03-11T07:41:30Z

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 11, 2026

🤖 Augment PR Summary

Summary: Fixes SFTP quote-command parsing in the libssh2 backend to correctly propagate errors when unexpected trailing data is present.

Changes: Adds a dedicated quote_error() helper and updates all affected branches to immediately return CURLE_QUOTE_ERROR after freeing quote paths.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

bagder added 2 commits March 11, 2026 08:43
avoid function name prefixed with 'return_'
Copy link
Copy Markdown

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

This PR fixes SFTP quote-command error handling in the SSH backends by ensuring the parser actually returns an error when it detects trailing/suspicious data after a command’s arguments, rather than continuing execution after freeing quote-path buffers.

Changes:

  • libssh2 backend: make “suspicious data after the command line” paths return CURLE_QUOTE_ERROR immediately (instead of just calling the helper and continuing).
  • Rename the quote-error helper to quote_error() in both libssh2 and libssh backends, aligning the helper name with the updated control flow.

Reviewed changes

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

File Description
lib/vssh/libssh2.c Ensures quote-parse “trailing data” errors immediately return CURLE_QUOTE_ERROR and renames the helper to quote_error().
lib/vssh/libssh.c Renames the helper to quote_error() (state-machine path already returned properly).

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

You can also share your feedback on Copilot code review. Take the survey.

@github-actions github-actions bot added the tests label Mar 11, 2026
@bagder bagder closed this in 53a3b21 Mar 11, 2026
@bagder bagder deleted the bagder/libssh2-return branch March 11, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants