Skip to content

Fix GH-25691: Crash on nested parse_ini_file() from a stream wrapper - #25692

Open
lazerg wants to merge 1 commit into
php:PHP-8.4from
lazerg:fix/gh-25691-nested-parse-ini
Open

lazerg wants to merge 1 commit into
php:PHP-8.4from
lazerg:fix/gh-25691-nested-parse-ini

Conversation

@lazerg

@lazerg lazerg commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

A user stream wrapper runs PHP code while zend_parse_ini_file() opens the file. A nested parse_ini_file() or parse_ini_string() there left CG(ini_parser_param) pointing at its own dead stack frame, and with sections enabled it also left BG(active_ini_file_section) pointing into its own result array. The outer parse then used both.

CG(ini_parser_param) is now set after the file is opened, and parse_ini_file()/parse_ini_string() restore the previous active section when they return.

Fixes #25691

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.

1 participant