aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-06-10 15:29:11 +0000
committerAndreas Schneider <mail@cynapses.org>2009-06-10 15:29:11 +0000
commitd14a492019ac04d3afbb0fb519d16c331dc4e93b (patch)
treefe8bfbf0d4dc346fc22b186a11a86820c500b017
parent848984f25f8d8009b250e53e9d1c13af0943ad08 (diff)
downloadlibssh-d14a492019ac04d3afbb0fb519d16c331dc4e93b.tar.gz
libssh-d14a492019ac04d3afbb0fb519d16c331dc4e93b.tar.xz
libssh-d14a492019ac04d3afbb0fb519d16c331dc4e93b.zip
Fix a infinite loop on error.
Thanks to Milo for the pointer. git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@776 7dcaeef0-15fb-0310-b436-a5af3365683c
-rw-r--r--libssh/channels.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libssh/channels.c b/libssh/channels.c
index 2b78645f..23f4ceb5 100644
--- a/libssh/channels.c
+++ b/libssh/channels.c
@@ -904,7 +904,9 @@ int channel_write(CHANNEL *channel, const void *data, u32 len) {
/* What happens when the channel window is zero? */
while(channel->remote_window == 0) {
/* parse every incoming packet */
- packet_wait(channel->session, 0, 0);
+ if (packet_wait(channel->session, 0, 0) == SSH_ERROR) {
+ goto error;
+ }
}
effectivelen = len > channel->remote_window ? channel->remote_window : len;
} else {