diff options
| author | Antony Dovgal <tony2001@php.net> | 2007-03-08 00:44:23 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2007-03-08 00:44:23 +0000 |
| commit | af1843f866a5681f5f58d77b55046d923f9b8a47 (patch) | |
| tree | 7f42520f82940d524c22580339f21954069e0313 /ext/standard/basic_functions.c | |
| parent | 8696c9bc89c925a7ee19a4c1e941a5c51ebb82a6 (diff) | |
| download | php-git-af1843f866a5681f5f58d77b55046d923f9b8a47.tar.gz | |
MFH: fix #40752 (parse_ini_file() segfaults when a scalar setting is redeclared as an array)
Diffstat (limited to 'ext/standard/basic_functions.c')
| -rw-r--r-- | ext/standard/basic_functions.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 94a49d78a0..fbaa8a23d0 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -6130,6 +6130,12 @@ static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, int callback_type, } } + if (Z_TYPE_P(hash) != IS_ARRAY) { + zval_dtor(hash); + INIT_PZVAL(hash); + array_init(hash); + } + ALLOC_ZVAL(element); *element = *arg2; zval_copy_ctor(element); |
