From c166a9ff5b7213276a3c14e00a9ba7f0ede98186 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Fri, 19 Jan 2018 14:12:18 +0100 Subject: Fix a possible double-execute Some extensions might hook `zend_execute_internal` for various reason, although few are doing it. We're not supposed to call the original function in our hook if someone else is hooking it. Thanks to @remicollet for the bug report and troubleshooting --- src/sp_execute.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sp_execute.c b/src/sp_execute.c index bf9c907..20fe509 100644 --- a/src/sp_execute.c +++ b/src/sp_execute.c @@ -131,10 +131,10 @@ static void sp_execute_ex(zend_execute_data *execute_data) { static void sp_zend_execute_internal(INTERNAL_FUNCTION_PARAMETERS) { is_in_eval_and_whitelisted(execute_data); - EX(func)->internal_function.handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); - if (UNEXPECTED(NULL != orig_zend_execute_internal)) { orig_zend_execute_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU); + } else { + EX(func)->internal_function.handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); } } -- cgit v1.3