From 5e13c7b7b1d2b2efc21098bc47d2047878d714a7 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Sat, 2 Dec 2023 19:15:18 +0000 Subject: [PATCH] Fixed issue #2221: Crash when other extensions run PHP code without the stack being initialised yet --- src/base/base.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/base/base.c b/src/base/base.c index 762ef77c9..267c96314 100644 --- a/src/base/base.c +++ b/src/base/base.c @@ -851,11 +851,6 @@ static bool should_run_user_handler(zend_execute_data *execute_data) return false; } - /* If the stack vector hasn't been initialised yet, we should abort immediately */ - if (!XG_BASE(stack)) { - return false; - } - return true; } @@ -864,6 +859,11 @@ static bool should_run_user_handler(zend_execute_data *execute_data) * negation should be **added** to the usage below in xdebug_execute_ex. */ static bool should_run_user_handler_wrapper(zend_execute_data *execute_data) { + /* If the stack vector hasn't been initialised yet, we should abort immediately */ + if (!XG_BASE(stack)) { + return false; + } + #if PHP_VERSION_ID >= 80100 return !should_run_user_handler(execute_data); #else