summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transports/ssh.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index ffa4a24a7..239e0bae7 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -136,9 +136,14 @@ static int ssh_stream_read(
* not-found error, so read from stderr and signal EOF on
* stderr.
*/
- if (rc == 0 && (rc = libssh2_channel_read_stderr(s->channel, buffer, buf_size)) > 0) {
- giterr_set(GITERR_SSH, "%*s", rc, buffer);
- return GIT_EEOF;
+ if (rc == 0) {
+ if ((rc = libssh2_channel_read_stderr(s->channel, buffer, buf_size)) > 0) {
+ 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;
+ }
}