-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
UBSan mb_convert_variables() with long string #17503
Comments
can't reproduce. First XML_MAXLEVEL prevents it from the get go. Even if I update it I still do not get the overflow in mbstring. But I guess it does not kill to put a check. |
I can reproduce. seems curious.
|
Ah right I can only reproduce with clang :) feel free to assign to yourself. |
php-src/ext/mbstring/mbstring.c Line 3351 in 675f359
I think we need to clamp the value instead of casting to array[i].demerits = MIN(array[i].demerits * array[i].multiplier, UINT64_MAX); @youkidearitai, regarding the "call to function through pointer to incorrect function type" errors, see #17462. TL; DR: also build with |
@cmb69 is right that merely casting, rather than clamping, will cause |
...Which, by the way, is my fault. 😄 Thanks to @YuanchengJiang for catching my mistake. |
Description
The following code:
Resulted in this output:
PHP Version
nightly
Operating System
No response
The text was updated successfully, but these errors were encountered: