diff options
author | andrewnester <andrew.nester.dev@gmail.com> | 2017-01-22 18:59:59 +0300 |
---|---|---|
committer | Joe Watkins <krakjoe@php.net> | 2017-01-22 16:11:25 +0000 |
commit | 6f912f7c045ae723d01a24504bf0ae0711fd8a4f (patch) | |
tree | a8295b5d6d7070b7af786956e0c6dd58d149d294 /Zend/zend_builtin_functions.c | |
parent | 71efe9d8fd0b7486c2943d267c68dcefc6c406b1 (diff) | |
download | php-git-6f912f7c045ae723d01a24504bf0ae0711fd8a4f.tar.gz |
Fixed #73969 - Fixed segmentation fault when debug_print_backtrace called
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r-- | Zend/zend_builtin_functions.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 1887c82676..8f77eb4f6d 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -2365,12 +2365,17 @@ ZEND_FUNCTION(debug_print_backtrace) if (call->func) { func = call->func; - function_name = (func->common.scope && - func->common.scope->trait_aliases) ? - ZSTR_VAL(zend_resolve_method_name( - (object ? object->ce : func->common.scope), func)) : - (func->common.function_name ? - ZSTR_VAL(func->common.function_name) : NULL); + zend_string *zend_function_name; + if (func->common.scope && func->common.scope->trait_aliases) { + zend_function_name = zend_resolve_method_name(object ? object->ce : func->common.scope, func); + } else { + zend_function_name = func->common.function_name; + } + if (zend_function_name != NULL) { + function_name = ZSTR_VAL(zend_function_name); + } else { + function_name = NULL; + } } else { func = NULL; function_name = NULL; |