diff options
| author | Ben Fuhrmannek | 2014-08-01 18:12:11 +0200 |
|---|---|---|
| committer | Ben Fuhrmannek | 2014-08-01 18:14:35 +0200 |
| commit | b074d630123a28cbca3babc756cbec6dede996f7 (patch) | |
| tree | 7b0d844551b00c59d8dc5f9283cbf72d1cd4e98c | |
| parent | 650d6c0c96e2a05b0deeca06a7104116d66b6894 (diff) | |
fixed potential segfault/hashtable inconsistency for disable_display_errors=fail
| -rw-r--r-- | suhosin.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -982,11 +982,12 @@ PHP_MINIT_FUNCTION(suhosin) | |||
| 982 | zend_ini_entry *i; | 982 | zend_ini_entry *i; |
| 983 | if (zend_hash_find(EG(ini_directives), "display_errors", sizeof("display_errors"), (void **) &i) == SUCCESS) { | 983 | if (zend_hash_find(EG(ini_directives), "display_errors", sizeof("display_errors"), (void **) &i) == SUCCESS) { |
| 984 | if (i->on_modify) { | 984 | if (i->on_modify) { |
| 985 | i->on_modify(i, "0", strlen("0"), i->mh_arg1, i->mh_arg2, i->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC); | ||
| 985 | if (SUHOSIN_G(disable_display_errors) > 1) { | 986 | if (SUHOSIN_G(disable_display_errors) > 1) { |
| 986 | zend_alter_ini_entry_ex("display_errors", sizeof("display_errors"), "0", sizeof("0"), ZEND_INI_SYSTEM, ZEND_INI_STAGE_STARTUP, 0 TSRMLS_CC); | 987 | i->value = estrdup("0"); |
| 988 | i->value_length = strlen(i->value); | ||
| 987 | i->on_modify = OnUpdate_fail; | 989 | i->on_modify = OnUpdate_fail; |
| 988 | } else { | 990 | } else { |
| 989 | i->on_modify(i, "Off", sizeof("off"), i->mh_arg1, i->mh_arg2, i->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC); | ||
| 990 | i->on_modify = NULL; | 991 | i->on_modify = NULL; |
| 991 | } | 992 | } |
| 992 | } | 993 | } |
