summaryrefslogtreecommitdiff
path: root/Zend/zend_ini.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2020-06-10 11:16:42 +0800
committerXinchen Hui <laruence@gmail.com>2020-06-10 11:16:42 +0800
commita297c09da5ad355d53a8e8ea72655a06d15b7bc7 (patch)
tree415ae0f6107487604a274e48705f61d0786e01ad /Zend/zend_ini.c
parent3c12c41927f6612bb59a8ed5edde9e27991a3b21 (diff)
downloadphp-git-a297c09da5ad355d53a8e8ea72655a06d15b7bc7.tar.gz
Partial fixed bug #79649 (Altering disable_functions from module init corrupts memory)
In module startup stage, we should not initiliaze EG(modified_ini_directives) as it use zend MM, the zend MM will be restart at the end of modules startup stage, by say "partial", because this issue still exists if altering ZEND_USER inis, we should add a zend_ini_deactive at the end of modules startup stage, but it brings some new cost, and I think no one would do things like that
Diffstat (limited to 'Zend/zend_ini.c')
-rw-r--r--Zend/zend_ini.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c
index e4b9e6bc5e..3f4c9d0930 100644
--- a/Zend/zend_ini.c
+++ b/Zend/zend_ini.c
@@ -341,15 +341,17 @@ ZEND_API int zend_alter_ini_entry_ex(zend_string *name, zend_string *new_value,
}
}
- if (!EG(modified_ini_directives)) {
- ALLOC_HASHTABLE(EG(modified_ini_directives));
- zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0);
- }
- if (!modified) {
- ini_entry->orig_value = ini_entry->value;
- ini_entry->orig_modifiable = modifiable;
- ini_entry->modified = 1;
- zend_hash_add_ptr(EG(modified_ini_directives), ini_entry->name, ini_entry);
+ if (ini_entry->modifiable != ZEND_INI_SYSTEM) {
+ if (!EG(modified_ini_directives)) {
+ ALLOC_HASHTABLE(EG(modified_ini_directives));
+ zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0);
+ }
+ if (!modified) {
+ ini_entry->orig_value = ini_entry->value;
+ ini_entry->orig_modifiable = modifiable;
+ ini_entry->modified = 1;
+ zend_hash_add_ptr(EG(modified_ini_directives), ini_entry->name, ini_entry);
+ }
}
duplicate = zend_string_copy(new_value);