From 2d9cebd20b8e2eeac8c0116876b5ba76bd4d24ee Mon Sep 17 00:00:00 2001 From: "Frode E. Moe" Date: Thu, 20 Apr 2017 17:34:10 -0400 Subject: [PATCH] Fix set_time_limit hanging on PHP 5.6 when pcntl_exec does not exist --- xdebug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xdebug.c b/xdebug.c index 54932db..c4e8768 100644 --- a/xdebug.c +++ b/xdebug.c @@ -1292,7 +1292,9 @@ PHP_RINIT_FUNCTION(xdebug) #if PHP_VERSION_ID >= 70000 orig = zend_hash_str_find_ptr(EG(function_table), "pcntl_exec", sizeof("pcntl_exec") - 1); #else - zend_hash_find(EG(function_table), "pcntl_exec", sizeof("pcntl_exec"), (void **)&orig); + if (zend_hash_find(EG(function_table), "pcntl_exec", sizeof("pcntl_exec"), (void **)&orig) == FAILURE) { + orig = NULL; + } #endif if (orig) { XG(orig_pcntl_exec_func) = orig->internal_function.handler;