Skip to content

zend_ini.c: fix zend_ini_bool_literal() with unknown INI setting#22209

Merged
Girgias merged 1 commit into
php:masterfrom
Girgias:fix-zend-ini-macros
Jun 3, 2026
Merged

zend_ini.c: fix zend_ini_bool_literal() with unknown INI setting#22209
Girgias merged 1 commit into
php:masterfrom
Girgias:fix-zend-ini-macros

Conversation

@Girgias
Copy link
Copy Markdown
Member

@Girgias Girgias commented Jun 2, 2026

Closes GH-22208

Copy link
Copy Markdown
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I like this, because zend_ini_parse_bool is also used in other contexts than zend_ini_str() where crashing for NULL inputs might be the right thing to do.

It might be cleaner to have a dedicated bool zend_ini_bool(const char *name, size_t name_length, bool orig) that is wrapped by zend_ini_bool_literal() and then contains the delegate to zend_ini_str + NULL check zend_ini_parse_bool.

But I don't have a strong opinion on this. The change definitely works.

@Girgias
Copy link
Copy Markdown
Member Author

Girgias commented Jun 3, 2026

Considering every other ones of the API's returns a default value, I think this is fine. If one want's to check for existence the zend_ini_*_ex() versions exist :)

@Girgias Girgias merged commit 4e4306a into php:master Jun 3, 2026
18 checks passed
@Girgias Girgias deleted the fix-zend-ini-macros branch June 3, 2026 13:16
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.

NULL-dereference in zend_ini_bool_literal() for non-existent INIs (PHP 8.6)

2 participants