You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UBSan address overflowed in ext/pcre/php_pcre.c #16184
<?php$string = 'This is a string. It contains numbers (0*9) as well as parentheses and some other things!';
$fusion = preg_replace(array('/\b\w{1}s/', '/(\d{1})*(\d{1})/', '/[\(!\)]/'), array('test', '$1 to $2', '*'), $string);
Resulted in this output:
/php-src/ext/pcre/php_pcre.c:1753:49: runtime error: addition of unsigned offset to 0x7fefcf8491f8 overflowed to 0x7fefcf8491f7
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/ext/pcre/php_pcre.c:1753:49
Activity
ndossche commentedon Oct 3, 2024
Looks like the offset for the copy is incorrectly used.
Edit: oh it's just the offset being -1. I'll check tonight what we need to do in that case.
Fix phpGH-16184: UBSan address overflowed in ext/pcre/php_pcre.c
Fix GH-16184: UBSan address overflowed in ext/pcre/php_pcre.c
Merge branch 'PHP-8.2' into PHP-8.3
Merge branch 'PHP-8.3' into PHP-8.4
Merge branch 'PHP-8.4'