Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't Use Array Unpacking for Status Code -> Error #1702

Closed

Conversation

chrisguitarguy
Copy link
Contributor

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 cee3f3c, 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:

$error = $this->status_codes[$status];

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 cee3f3c, 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
@chrisguitarguy chrisguitarguy changed the title Don't Use Array Unpackage for Status Code -> Error Don't Use Array Unpacking for Status Code -> Error Oct 13, 2021
@terrafrost
Copy link
Member

I cherry-picked your commit to the 3.0 branch and merged it into master:

24150b2

Thanks!

@terrafrost terrafrost closed this Oct 14, 2021
@chrisguitarguy chrisguitarguy deleted the fix_log_error branch October 14, 2021 02:14
@chrisguitarguy
Copy link
Contributor Author

@terrafrost cool, thanks! Any idea when this will be in a release?

@terrafrost
Copy link
Member

Probably next weekend. I've been attending https://www.longhornphp.com/#/ this weekend! That conference just finished but I got other stuff I still gotta do this weekend too lol

@terrafrost
Copy link
Member

I'm actually gonna try to launch the new version in the middle of this coming week or next weekend.

I've been working on adding compression support (zlib and zlib@openssh.com) and I feel like I'm really close. It'd be cool to have it included in the new release but it won't be if I do the release tonight. Still need a few more days to clean that up and get it all tested and all that jazz.

If I don't include it in the upcoming release it could be a few months before a release includes it. Which isn't necessarily a problem lol but I'd just assume have it be included in the next release if at all possible!

@chrisguitarguy
Copy link
Contributor Author

I'm actually gonna try to launch the new version in the middle of this coming week or next weekend.

Sounds good! Thank you for keeping me updated.

@terrafrost
Copy link
Member

A new version has been released.

Thanks for waiting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants