From fe4dc433cc66b2fe854cd8fd50c04079995d2c22 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Thu, 11 Nov 2021 19:06:18 -0600 Subject: [PATCH] SSH2: error out when no data is received from the server --- phpseclib/Net/SSH2.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index a95a3fd8..89e57487 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -3537,7 +3537,8 @@ class Net_SSH2 $raw = fread($this->fsock, $this->decrypt_block_size); if (!strlen($raw)) { - return ''; + user_error('No data received from server'); + return false; } if ($this->decrypt !== false) {