libssh2: fix error handling on quote errors#20883
Conversation
Previously it lacked the actual return. Reported-by: m777m0 on hackerone Follow-up to 578706a
|
@aisle-analyzer augment review |
🔒 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 Last updated on: 2026-03-11T07:41:30Z |
🤖 Augment PR SummarySummary: Fixes SFTP quote-command parsing in the libssh2 backend to correctly propagate errors when unexpected trailing data is present. 🤖 Was this summary useful? React with 👍 or 👎 |
avoid function name prefixed with 'return_'
There was a problem hiding this comment.
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_ERRORimmediately (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.
Previously it lacked the actual return.
Reported-by: m777m0 on hackerone
Follow-up to 578706a