Skip to content

libssh: propagate error back in SFTP function#21122

Closed
bagder wants to merge 1 commit intomasterfrom
bagder/libssh-propagate
Closed

libssh: propagate error back in SFTP function#21122
bagder wants to merge 1 commit intomasterfrom
bagder/libssh-propagate

Conversation

@bagder
Copy link
Copy Markdown
Member

@bagder bagder commented Mar 27, 2026

The myssh_in_SFTP_READDIR_BOTTOM() function would not store the error code correctly thus it could be ignored and missed when an error was returned at that particular moment.

Follow-up to 3c26e6a

Found by Codex Security

The myssh_in_SFTP_READDIR_BOTTOM() function would not store the error
code correctly thus it could be ignored and missed when an error was
returned at that particular moment.

Follow-up to 3c26e6a

Found by Codex Security
@bagder bagder changed the title libssh: propgate error back on SFTP function libssh: propgate error back in SFTP function Mar 27, 2026
@bagder bagder requested a review from Copilot March 27, 2026 14:56
@bagder bagder marked this pull request as ready for review March 27, 2026 14:58
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

Fixes libssh SFTP directory listing state machine behavior so write/transfer errors occurring in myssh_in_SFTP_READDIR_BOTTOM() are properly captured and returned to the caller, preventing them from being silently ignored.

Changes:

  • Store the CURLcode error into sshc->actualcode when the READDIR_BOTTOM write step fails.
  • Add braces around the error-handling if(result) block for the updated logic.

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

@bagder bagder changed the title libssh: propgate error back in SFTP function libssh: propagate error back in SFTP function Mar 27, 2026
@bagder bagder closed this in ff678be Mar 27, 2026
@bagder bagder deleted the bagder/libssh-propagate branch March 27, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants