diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 19c4298a..566e7d1b 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1858,6 +1858,10 @@ class Net_SSH2 { $raw = fread($this->fsock, $this->decrypt_block_size); $stop = strtok(microtime(), ' ') + strtok(''); + if (empty($raw)) { + return ''; + } + if ($this->decrypt !== false) { $raw = $this->decrypt->decrypt($raw); } @@ -2013,6 +2017,10 @@ class Net_SSH2 { return false; } + if (empty($response)) { + return ''; + } + extract(unpack('Ctype/Nchannel', $this->_string_shift($response, 5))); switch ($this->channel_status[$channel]) {