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
Segmentation fault (index oob) in ext/bcmath/libbcmath/src/convert.c:155 #16265
/php-src/ext/bcmath/libbcmath/src/convert.c:155:68: runtime error: index 8791595 out of bounds for type 'const unsigned char[100]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/ext/bcmath/libbcmath/src/convert.c:155:68
No, slightly different cause than #16262.
The problem here is that quot_real_arr_size is 0, so the loop for (i = 0; i < quot_real_arr_size - 1; i++) { goes OOB.
However, the loop must write bytes because otherwise the numbers in bc_num are uninitialized.
Activity
ndossche commentedon Oct 6, 2024
Likely same root cause as #16262
cmb69 commentedon Oct 6, 2024
Simplified reproducer:
ndossche commentedon Oct 6, 2024
No, slightly different cause than #16262.
The problem here is that
quot_real_arr_sizeis 0, so the loopfor (i = 0; i < quot_real_arr_size - 1; i++) {goes OOB.However, the loop must write bytes because otherwise the numbers in bc_num are uninitialized.
Added early return case when result is 0 (#16697)