Skip to content

Commit 4e4306a

Browse files
authored
zend_ini.c: fix zend_ini_bool_literal() with unknown INI setting (#22209)
Closes GH-22208
1 parent 9f96285 commit 4e4306a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Zend/zend_ini.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ ZEND_API zend_string *zend_ini_get_value(zend_string *name) /* {{{ */
561561

562562
ZEND_API bool zend_ini_parse_bool(const zend_string *str)
563563
{
564+
/* May happen if an unknown INI setting is queried via zend_ini_bool_literal(),
565+
* as zend_ini_str() would return NULL */
566+
if (UNEXPECTED(str == NULL)) {
567+
return false;
568+
}
564569
if (zend_string_equals_literal_ci(str, "true")
565570
|| zend_string_equals_literal_ci(str, "yes")
566571
|| zend_string_equals_literal_ci(str, "on")

0 commit comments

Comments
 (0)