From 85205bf6d5ea62249ed31585e31c39ed16747714 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 14 Jun 2022 05:30:24 -0500 Subject: [PATCH] SSH2: set channel closure flag elsewhere as well --- phpseclib/Net/SFTP.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 4d5c4200..f6cffeac 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -3673,6 +3673,9 @@ class Net_SFTP extends Net_SSH2 while ($tempLength > 0) { $temp = $this->_get_channel_packet(NET_SFTP_CHANNEL, true); if (is_bool($temp)) { + if ($temp && $this->channel_status[NET_SFTP_CHANNEL] === NET_SSH2_MSG_CHANNEL_CLOSE) { + $this->channel_close = true; + } $this->packet_type = false; $this->packet_buffer = ''; return false;