summaryrefslogtreecommitdiffstats
path: root/2d9cebd20b8e2eeac8c0116876b5ba76bd4d24ee.patch
blob: 13fe7ad8bec89d31dc401691f9d281b2e0a3d4ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From 2d9cebd20b8e2eeac8c0116876b5ba76bd4d24ee Mon Sep 17 00:00:00 2001
From: "Frode E. Moe" <fluff.github@git.noloop.net>
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;