diff options
| author | Stanislav Malyshev <stas@php.net> | 2009-08-18 20:51:49 +0000 |
|---|---|---|
| committer | Stanislav Malyshev <stas@php.net> | 2009-08-18 20:51:49 +0000 |
| commit | d6ba6c69fb3054ed3eefb6c4c6f8ad1bfb728037 (patch) | |
| tree | 322c8344f65013c732a7ce250074a1fa48722119 /Zend/zend_execute_API.c | |
| parent | 827469c94e9d3ec554dabcb79f478e06b31f6a14 (diff) | |
| download | php-git-d6ba6c69fb3054ed3eefb6c4c6f8ad1bfb728037.tar.gz | |
fix crash when unexpectedly passed by-ref parameter is modified
Diffstat (limited to 'Zend/zend_execute_API.c')
| -rw-r--r-- | Zend/zend_execute_API.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 935133da11..ee46026021 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -837,6 +837,12 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS for (i=0; i<fci->param_count; i++) { zval *param; + if(EX(function_state).function->type == ZEND_INTERNAL_FUNCTION + && !ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1) + && PZVAL_IS_REF(*fci->params[i])) { + SEPARATE_ZVAL(fci->params[i]); + } + if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1) && !PZVAL_IS_REF(*fci->params[i])) { |
