From 24150b26f6361ba871a865d65d87007753db88e1 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Wed, 13 Oct 2021 10:23:31 -0500 Subject: [PATCH] Don't Use Array Unpackage for Status Code -> Error the `status_codes` property is an array with integer keys and string values, but the `$error` value in `SFTP::logError` was trying to be unpacked from an array. Seems to come from cee3f3cd4a8b469b8250cde6d130e2c06faae7ed, but even at that commit the `status_codes` data structure was still an array. This bug is only present in 3.X, 2.X release didn't unpack here: https://github.com/phpseclib/phpseclib/blob/a684f120653d6c0d1b1fb25f4c75c2bf57252965/phpseclib/Net/SFTP.php#L829 --- phpseclib/Net/SFTP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index ae80e59e..536a45cb 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -807,7 +807,7 @@ class SFTP extends SSH2 list($status) = Strings::unpackSSH2('N', $response); } - list($error) = $this->status_codes[$status]; + $error = $this->status_codes[$status]; if ($this->version > 2) { list($message) = Strings::unpackSSH2('s', $response);