mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
libssh: propagate error back in SFTP function
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 3c26e6a896
Found by Codex Security
Closes #21122
This commit is contained in:
parent
86b39c2226
commit
ff678be69a
@ -519,8 +519,10 @@ static int myssh_in_SFTP_READDIR_BOTTOM(struct Curl_easy *data,
|
||||
ssh_string_free_char(sshc->readdir_tmp);
|
||||
sshc->readdir_tmp = NULL;
|
||||
|
||||
if(result)
|
||||
if(result) {
|
||||
myssh_to(data, sshc, SSH_STOP);
|
||||
sshc->actualcode = result;
|
||||
}
|
||||
else
|
||||
myssh_to(data, sshc, SSH_SFTP_READDIR);
|
||||
return SSH_NO_ERROR;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user