summaryrefslogtreecommitdiff
path: root/ext/pcntl
diff options
context:
space:
mode:
authorDavid Walker <dave@mudsite.com>2016-07-06 06:45:20 -0600
committerAaron Piotrowski <aaron@trowski.com>2016-07-06 13:57:37 -0500
commitfcda3c8adae29e87b8717c91e2aa073d708e9e84 (patch)
tree7781b9bd723a47512e4b6a21bd1927e0d0aad933 /ext/pcntl
parent217dcbcd911ad0552a4435fe979c069a5ddaef9f (diff)
downloadphp-git-fcda3c8adae29e87b8717c91e2aa073d708e9e84.tar.gz
Fix to not attempt to call if handler is long. Idea for this came
from comment on PR.
Diffstat (limited to 'ext/pcntl')
-rw-r--r--ext/pcntl/pcntl.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index 811f7406ce..67168868b7 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -1392,14 +1392,16 @@ void pcntl_signal_dispatch()
while (queue) {
if ((handle = zend_hash_index_find(&PCNTL_G(php_signal_table), queue->signo)) != NULL) {
- ZVAL_NULL(&retval);
- ZVAL_LONG(&param, queue->signo);
-
- /* Call php signal handler - Note that we do not report errors, and we ignore the return value */
- /* FIXME: this is probably broken when multiple signals are handled in this while loop (retval) */
- call_user_function(EG(function_table), NULL, handle, &retval, 1, &param);
- zval_ptr_dtor(&param);
- zval_ptr_dtor(&retval);
+ if (Z_TYPE_P(handle) != IS_LONG) {
+ ZVAL_NULL(&retval);
+ ZVAL_LONG(&param, queue->signo);
+
+ /* Call php signal handler - Note that we do not report errors, and we ignore the return value */
+ /* FIXME: this is probably broken when multiple signals are handled in this while loop (retval) */
+ call_user_function(EG(function_table), NULL, handle, &retval, 1, &param);
+ zval_ptr_dtor(&param);
+ zval_ptr_dtor(&retval);
+ }
}
next = queue->next;