1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-04 18:48:24 +01:00

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 cee3f3cd4a, 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:
a684f12065/phpseclib/Net/SFTP.php (L829)
This commit is contained in:
Christopher Davis 2021-10-13 10:23:31 -05:00 committed by terrafrost
parent 2ec8356121
commit 24150b26f6

View File

@ -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);