mirror of
https://github.com/curl/curl.git
synced 2026-07-24 09:57:21 +03:00
libssh: if sftp_init fails, don't get the sftp error code
This flow extracted the wrong code (sftp code instead of ssh code), and the code is sometimes (erroneously) returned as zero anyway, so skip getting it and set a generic error. Reported-by: David McLaughlin Fixes #9737 Closes #9740
This commit is contained in:
parent
9660f23010
commit
bdaa6dd5ba
1 changed files with 1 additions and 2 deletions
|
|
@ -963,10 +963,9 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block)
|
|||
|
||||
rc = sftp_init(sshc->sftp_session);
|
||||
if(rc != SSH_OK) {
|
||||
rc = sftp_get_error(sshc->sftp_session);
|
||||
failf(data, "Failure initializing sftp session: %s",
|
||||
ssh_get_error(sshc->ssh_session));
|
||||
MOVE_TO_ERROR_STATE(sftp_error_to_CURLE(rc));
|
||||
MOVE_TO_ERROR_STATE(sftp_error_to_CURLE(SSH_FX_FAILURE));
|
||||
break;
|
||||
}
|
||||
state(data, SSH_SFTP_REALPATH);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue