com php-src: Fix to not attempt to call if handler is long. Idea for this came from comment on PR.: ext/pcntl/pcntl.c
| From: | Aaron Piotrowski | Date: | Wed, 06 Jul 2016 18:57:37 +0000 |
| Subject: | com php-src: Fix to not attempt to call if handler is long. Idea for this came from comment on PR.: ext/pcntl/pcntl.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-92842@lists.php.net to get a copy of this message | ||
Commit: fcda3c8adae29e87b8717c91e2aa073d708e9e84
Author: David Walker <dave@mudsite.com> Wed, 6 Jul 2016 06:45:20 -0600
Committer: Aaron Piotrowski <aaron@trowski.com> Wed, 6 Jul 2016 13:57:37 -0500
Parents: 217dcbcd911ad0552a4435fe979c069a5ddaef9f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fcda3c8adae29e87b8717c91e2aa073d708e9e84
Log:
Fix to not attempt to call if handler is long. Idea for this came
from comment on PR.
Changed paths:
M ext/pcntl/pcntl.c
Diff:
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index 811f740..6716886 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(¶m, 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, ¶m);
- zval_ptr_dtor(¶m);
- zval_ptr_dtor(&retval);
+ if (Z_TYPE_P(handle) != IS_LONG) {
+ ZVAL_NULL(&retval);
+ ZVAL_LONG(¶m, 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, ¶m);
+ zval_ptr_dtor(¶m);
+ zval_ptr_dtor(&retval);
+ }
}
next = queue->next;