diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index a9c99e5e..2162b9c7 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -3335,7 +3335,8 @@ class SSH2 $raw = stream_get_contents($this->fsock, $this->decrypt_block_size); if (!strlen($raw)) { - return ''; + $this->bitmap = 0; + throw new ConnectionClosedException('No data received from server'); } if ($this->decrypt) {