]> granicus.if.org Git - php/commitdiff
Fix crash bug on malformed .ini file
authorStanislav Malyshev <stas@php.net>
Sun, 11 Nov 2001 12:41:14 +0000 (12:41 +0000)
committerStanislav Malyshev <stas@php.net>
Sun, 11 Nov 2001 12:41:14 +0000 (12:41 +0000)
ext/standard/basic_functions.c

index 45ebbdf50d5a53eac2c8fcc428b6dae8ac80b57a..94869275c6ce7c13832b80b325bade9d315f0794 100644 (file)
@@ -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 {