Skip to content

Fix GH-24489: Restore mbstring buffer growth fix lost in merge - #24522

Open
lazerg wants to merge 1 commit into
php:masterfrom
lazerg:fix/gh-24489-mbstring-lost-hunk
Open

lazerg wants to merge 1 commit into
php:masterfrom
lazerg:fix/gh-24489-mbstring-lost-hunk

Conversation

@lazerg

@lazerg lazerg commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

The PHP-8.6 into master merge (9705fda) dropped the buf->out/buf->limit sync from the failure path of mb_convert_buf_ensure(), along with its test. So when a second buffer growth fails, buf->out still points into the old, freed buffer, and mb_convert_buf_result() writes through it and computes a bogus length. With the tracked allocator this trips the end >= p assertion in zend_memnstr() from mb_substr_count(). This puts the three lines back and restores oom_buf_growth.phpt from PHP-8.6, so the mbstring libmbfl code matches PHP-8.6 again.

Fixes GH-24489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

master: part of the mbstring bailout fix got lost in a merge

1 participant