Skip to content

Fix php_embed_ub_write() infinite loop on failed write - #23427

Open
lazerg wants to merge 1 commit into
php:PHP-8.2from
lazerg:fix/issue-23423-embed-ub-write-infinite-loop
Open

Fix php_embed_ub_write() infinite loop on failed write#23427
lazerg wants to merge 1 commit into
php:PHP-8.2from
lazerg:fix/issue-23423-embed-ub-write-infinite-loop

Conversation

@lazerg

@lazerg lazerg commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

php_embed_ub_write() never decrements remaining when php_embed_single_write() returns 0, so if php_handle_aborted_connection() doesn't actually abort (e.g. ignore_user_abort=1), the write loop spins forever. sapi_cgi_ub_write() already returns str_length - remaining in this same situation, so this makes php_embed_ub_write() do the same.

Fixes #23423

@Sjord

Sjord commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Thanks. Looks good to me.

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

Successfully merging this pull request may close these issues.

2 participants