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

mbstring.func_overload #4

Closed
paragonie-scott opened this issue Mar 10, 2016 · 3 comments
Closed

mbstring.func_overload #4

paragonie-scott opened this issue Mar 10, 2016 · 3 comments

Comments

@paragonie-scott
Copy link
Contributor

php -dmbstring.func_overload=7 test.php

<?php
var_dump(strlen("\xF0\x9D\xA5\xB3"));

Guess what this produces.


Using strlen() and substr() for crypto can be dangerous, especially since you work with raw binary.

@ezimuel
Copy link
Owner

ezimuel commented Mar 10, 2016

@paragonie-scott right, I should use mb_strlen() and mb_substr() for binary data. I'll fix this shortly. Thanks again for your suggestion!

@ezimuel
Copy link
Owner

ezimuel commented Mar 10, 2016

@paragonie-scott I fixed in master.

@ezimuel ezimuel closed this as completed Mar 10, 2016
@paragonie-scott
Copy link
Contributor Author

👍

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

No branches or pull requests

2 participants