mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 20:30:38 +09:00
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.
This commit is contained in:
committed by
Andreas Schneider
parent
525324b2f9
commit
4e153aed8a
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user