1
0
mirror of https://github.com/php/php-src.git synced 2026-04-10 01:23:53 +02:00

Fixed segfault in BEGIN/END SILENT

This commit is contained in:
Xinchen Hui
2014-02-19 18:34:27 +08:00
parent c1c4d26817
commit 757facf6c1
2 changed files with 2 additions and 2 deletions

View File

@@ -4676,7 +4676,7 @@ ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY)
EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value)) {
efree(EG(error_reporting_ini_entry)->value);
}
EG(error_reporting_ini_entry)->value = Z_STRVAL(restored_error_reporting);
EG(error_reporting_ini_entry)->value = estrndup(Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting));
EG(error_reporting_ini_entry)->value_length = Z_STRLEN(restored_error_reporting);
} else {
zval_dtor(&restored_error_reporting);

View File

@@ -8100,7 +8100,7 @@ static int ZEND_FASTCALL ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value)) {
efree(EG(error_reporting_ini_entry)->value);
}
EG(error_reporting_ini_entry)->value = Z_STRVAL(restored_error_reporting);
EG(error_reporting_ini_entry)->value = estrndup(Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting));
EG(error_reporting_ini_entry)->value_length = Z_STRLEN(restored_error_reporting);
} else {
zval_dtor(&restored_error_reporting);