aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Stöneberg <oliverst@online.de>2011-05-16 06:45:11 -0700
committerAndreas Schneider <asn@cryptomilk.org>2011-05-17 14:20:56 +0200
commit4e153aed8a943b636135b424e052fc69392ad87c (patch)
tree4c42faf8d1f8cc88b2f9d42be597f9d2379c1749
parent525324b2f9ee2bd9a39ba88267e76c88e7f58bd1 (diff)
downloadlibssh-4e153aed8a943b636135b424e052fc69392ad87c.tar.gz
libssh-4e153aed8a943b636135b424e052fc69392ad87c.tar.xz
libssh-4e153aed8a943b636135b424e052fc69392ad87c.zip
channel: Fixed potential use-after-free in ssh_channel_get_exit_status().
If ssh_channel_get_exit_status() is called more than once and the connection closed.
-rw-r--r--src/channels.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/channels.c b/src/channels.c
index d5056618..b9ba0514 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -2616,7 +2616,7 @@ int ssh_channel_get_exit_status(ssh_channel channel) {
return -1;
}
- while (channel->remote_eof == 0 || channel->exit_status == -1) {
+ while ((channel->remote_eof == 0 || channel->exit_status == -1) && channel->session->alive) {
/* Parse every incoming packet */
if (ssh_handle_packets(channel->session,-1) != SSH_OK) {
return -1;