From a02526e5e0e17f6d15438a773e9cd3d930fb5048 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 5 Jul 2021 08:33:42 -0500 Subject: [PATCH 1/2] SFTP: return false if get_channel_packet returns false --- phpseclib/Net/SFTP.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 74a29739..ef74dcae 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -3169,6 +3169,9 @@ class Net_SFTP extends Net_SSH2 $this->packet_buffer = ''; return false; } + if ($temp === false) { + return false; + } $this->packet_buffer.= $temp; } if (strlen($this->packet_buffer) < 4) { From 8186db75339b0ee0cad62cc4405e7b3cede84bdc Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 5 Jul 2021 08:35:39 -0500 Subject: [PATCH 2/2] SFTP: get_channel_packet throws exceptions in 3.0 --- phpseclib/Net/SFTP.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index fe5a7867..ce5a757b 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -2947,9 +2947,6 @@ class SFTP extends SSH2 $this->packet_buffer = ''; return false; } - if ($temp === false) { - return false; - } $this->packet_buffer.= $temp; } if (strlen($this->packet_buffer) < 4) {