Skip to content

Commit 28b4761

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Partial fixed bug #79649 (Altering disable_functions from module init corrupts memory)
2 parents a60cdcf + a297c09 commit 28b4761

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Zend/zend_ini.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,17 @@ ZEND_API int zend_alter_ini_entry_ex(zend_string *name, zend_string *new_value,
335335
}
336336
}
337337

338-
if (!EG(modified_ini_directives)) {
339-
ALLOC_HASHTABLE(EG(modified_ini_directives));
340-
zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0);
341-
}
342-
if (!modified) {
343-
ini_entry->orig_value = ini_entry->value;
344-
ini_entry->orig_modifiable = modifiable;
345-
ini_entry->modified = 1;
346-
zend_hash_add_ptr(EG(modified_ini_directives), ini_entry->name, ini_entry);
338+
if (ini_entry->modifiable != ZEND_INI_SYSTEM) {
339+
if (!EG(modified_ini_directives)) {
340+
ALLOC_HASHTABLE(EG(modified_ini_directives));
341+
zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0);
342+
}
343+
if (!modified) {
344+
ini_entry->orig_value = ini_entry->value;
345+
ini_entry->orig_modifiable = modifiable;
346+
ini_entry->modified = 1;
347+
zend_hash_add_ptr(EG(modified_ini_directives), ini_entry->name, ini_entry);
348+
}
347349
}
348350

349351
duplicate = zend_string_copy(new_value);

0 commit comments

Comments
 (0)