From a965060d815b138795774d5b4d949421950ec716 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Wed, 4 May 2022 01:18:33 -0500 Subject: [PATCH] SSH2: make login method return false under rare situation --- phpseclib/Net/SSH2.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 6c71f3ac..1658c553 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -2468,7 +2468,9 @@ class SSH2 $this->send_binary_packet($packet, $logged); $response = $this->get_binary_packet(); - + if ($response === false) { + return false; + } list($type) = Strings::unpackSSH2('C', $response); switch ($type) { case NET_SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ: // in theory, the password can be changed