mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-12 12:00:29 +00:00
Merge pull request #3562 from mgorny/ssh-read-stderr-fail
ssh_stream_read(): fix possible *bytes_read < 0 branch
This commit is contained in:
commit
700f0aff24
@ -136,9 +136,14 @@ static int ssh_stream_read(
|
|||||||
* not-found error, so read from stderr and signal EOF on
|
* not-found error, so read from stderr and signal EOF on
|
||||||
* stderr.
|
* stderr.
|
||||||
*/
|
*/
|
||||||
if (rc == 0 && (rc = libssh2_channel_read_stderr(s->channel, buffer, buf_size)) > 0) {
|
if (rc == 0) {
|
||||||
giterr_set(GITERR_SSH, "%*s", rc, buffer);
|
if ((rc = libssh2_channel_read_stderr(s->channel, buffer, buf_size)) > 0) {
|
||||||
return GIT_EEOF;
|
giterr_set(GITERR_SSH, "%*s", rc, buffer);
|
||||||
|
return GIT_EEOF;
|
||||||
|
} else if (rc < LIBSSH2_ERROR_NONE) {
|
||||||
|
ssh_error(s->session, "SSH could not read stderr");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user