diff options
author | Oliver Stöneberg <oliverst@online.de> | 2011-05-16 06:45:11 -0700 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-05-17 20:57:38 +0200 |
commit | 8154e240279ac2c54500270eb7d6f39354eb5156 (patch) | |
tree | 83322bc075cd77aba29cccdca9c087a905ffba57 | |
parent | 629cfbccc44da2a3eda66ec665d2f98ad93be0b6 (diff) | |
download | libssh-8154e240279ac2c54500270eb7d6f39354eb5156.tar.gz libssh-8154e240279ac2c54500270eb7d6f39354eb5156.tar.xz libssh-8154e240279ac2c54500270eb7d6f39354eb5156.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.
(cherry picked from commit 4e153aed8a943b636135b424e052fc69392ad87c)
-rw-r--r-- | src/channels.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/channels.c b/src/channels.c index cf4b468d..1b652e95 100644 --- a/src/channels.c +++ b/src/channels.c @@ -2495,7 +2495,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; |