From: Stanislav Malyshev Date: Sun, 11 Nov 2001 12:41:14 +0000 (+0000) Subject: Fix crash bug on malformed .ini file X-Git-Tag: ChangeLog~353 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88c66d4859ba3ecc0b015259f78e905a5fe4df8c;p=php Fix crash bug on malformed .ini file --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 45ebbdf50d..94869275c6 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -2632,6 +2632,10 @@ static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, int callback_type, switch (callback_type) { case ZEND_INI_PARSER_ENTRY: + if(!arg2) { + /* bare string - nothing to do */ + break; + } ALLOC_ZVAL(element); *element = *arg2; zval_copy_ctor(element); @@ -2655,6 +2659,11 @@ static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, int callback { zval *active_arr; + if(!arg2) { + /* bare string - nothing to do */ + break; + } + if (BG(active_ini_file_section)) { active_arr = BG(active_ini_file_section); } else {