mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +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.
(cherry picked from commit 4e153aed8a)
This commit is contained in:
committed by
Andreas Schneider
parent
629cfbccc4
commit
8154e24027
@@ -2495,7 +2495,7 @@ int ssh_channel_get_exit_status(ssh_channel channel) {
|
|||||||
return -1;
|
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 */
|
/* Parse every incoming packet */
|
||||||
if (ssh_handle_packets(channel->session,-1) != SSH_OK) {
|
if (ssh_handle_packets(channel->session,-1) != SSH_OK) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user