diff options
| author | Andreas Schneider <mail@cynapses.org> | 2009-04-08 12:56:12 +0000 |
|---|---|---|
| committer | Andreas Schneider <mail@cynapses.org> | 2009-04-08 12:56:12 +0000 |
| commit | da1eee8c89e45fcce801c1e8ac6d944789f9f3be (patch) | |
| tree | 8d735855a409fdf211b30d012668de45363bf955 /libssh | |
| parent | 8948bf41f1994429526fedb0c629d355b1f14cfe (diff) | |
| download | libssh-da1eee8c89e45fcce801c1e8ac6d944789f9f3be.tar.gz libssh-da1eee8c89e45fcce801c1e8ac6d944789f9f3be.tar.xz libssh-da1eee8c89e45fcce801c1e8ac6d944789f9f3be.zip | |
Fix header functions and add return value checks.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@430 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh')
| -rw-r--r-- | libssh/channels1.c | 4 | ||||
| -rw-r--r-- | libssh/packet.c | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/libssh/channels1.c b/libssh/channels1.c index 6a7a3f26..f1bcbe8a 100644 --- a/libssh/channels1.c +++ b/libssh/channels1.c @@ -283,7 +283,9 @@ int channel_handle1(SSH_SESSION *session, int type) { } break; case SSH_SMSG_EXITSTATUS: - channel_rcv_close1(session); + if (channel_rcv_close1(session) < 0) { + return -1; + } break; default: ssh_log(session, SSH_LOG_FUNCTIONS, "Unexepected message %d", type); diff --git a/libssh/packet.c b/libssh/packet.c index 4802fe6e..179341fd 100644 --- a/libssh/packet.c +++ b/libssh/packet.c @@ -460,7 +460,9 @@ void packet_parse(SSH_SESSION *session){ case SSH_SMSG_STDOUT_DATA: case SSH_SMSG_STDERR_DATA: case SSH_SMSG_EXITSTATUS: - channel_handle1(session,type); + if (channel_handle1(session,type) < 0) { + return; + } return; case SSH_MSG_DEBUG: case SSH_MSG_IGNORE: @@ -525,7 +527,10 @@ static int packet_wait1(SSH_SESSION *session,int type,int blocking){ case SSH_SMSG_STDOUT_DATA: case SSH_SMSG_STDERR_DATA: case SSH_SMSG_EXITSTATUS: - channel_handle1(session,type); + if (channel_handle1(session,type) < 0) { + leave_function(); + return -1; + } break; case SSH_MSG_DEBUG: case SSH_MSG_IGNORE: |
