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

[topic/40730] Use strlen() instead of count() in function _equals() of C... #3

Merged
merged 1 commit into from
Jun 6, 2012

Conversation

bantu
Copy link
Member

@bantu bantu commented Jun 6, 2012

...rypt_RSA.

It appears that count() always returns int(1) on strings. Thus, this check is
pointless as is. strlen() was meant here and is actually required to prevent
E_NOTICEs from invalid array accesses using $y[$i].

As per http://www.frostjedi.com/phpbb/viewtopic.php?f=46&t=40730

…f Crypt_RSA.

It appears that count() always returns int(1) on strings. Thus, this check is
pointless as is. strlen() was meant here and is actually required to prevent
E_NOTICEs from invalid array accesses using $y[$i].
@terrafrost terrafrost merged commit 71dea1f into phpseclib:master Jun 6, 2012
slowbro pushed a commit to slowbro/phpseclib that referenced this pull request Nov 13, 2012
Use exceptions instead of user_error()
phpsyscoder added a commit that referenced this pull request Feb 26, 2013
@Ennorath Ennorath mentioned this pull request Oct 13, 2016
@zgelici zgelici mentioned this pull request Jul 31, 2020
uzulla added a commit to uzulla/phpseclib that referenced this pull request Jan 18, 2022
I got some error.

```
 Implicit conversion from float 992216.1102294922 to int loses precision

---

#0 [internal function]: {closure}()
phpseclib#1 /some/path/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php(3504): stream_select()
phpseclib#2 /some/path/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php(3922): phpseclib\Net\SSH2->_get_binary_packet()
phpseclib#3 /some/path/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php(537): phpseclib\Net\SSH2->_get_channel_packet()
phpseclib#4 /some/path/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php(638): phpseclib\Net\SFTP->_partial_init_sftp_connection()
phpseclib#5 /some/path/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php(505): phpseclib\Net\SFTP->_init_sftp_connection()
phpseclib#6 /some/path/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php(937): phpseclib\Net\SFTP->_precheck()
phpseclib#7 /some/path/vendor/league/flysystem-sftp/src/SftpAdapter.php(278): phpseclib\Net\SFTP->chdir()
phpseclib#8 /some/path/vendor/league/flysystem-sftp/src/SftpAdapter.php(208): League\Flysystem\Sftp\SftpAdapter->setConnectionRoot()
phpseclib#9 /some/path/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php(650): League\Flysystem\Sftp\SftpAdapter->connect()
phpseclib#10 /some/path/vendor/league/flysystem-sftp/src/SftpAdapter.php(453): League\Flysystem\Adapter\AbstractFtpAdapter->getConnection()
phpseclib#11 /some/path/vendor/league/flysystem-sftp/src/SftpAdapter.php(436): League\Flysystem\Sftp\SftpAdapter->upload()
phpseclib#12 /some/path/myApp.php(32): League\Flysystem\Sftp\SftpAdapter->writeStream()

```
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