]> granicus.if.org Git - php/commitdiff
- fix bug #37635 (parameter of pcntl signal handler is trashed)
authorMichael Wallner <mike@php.net>
Tue, 30 May 2006 17:40:52 +0000 (17:40 +0000)
committerMichael Wallner <mike@php.net>
Tue, 30 May 2006 17:40:52 +0000 (17:40 +0000)
NEWS
ext/pcntl/pcntl.c

diff --git a/NEWS b/NEWS
index 0588b8358ef9cbe7f333b2feb9d677a2b8c532d8..55c5629b70f9d666a839a95e2d20d0fc9021551f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -49,10 +49,11 @@ PHP                                                                        NEWS
 - Added RFC2397 (data: stream) support. (Marcus)
 - Fixed memory leaks in openssl streams context options (Pierre)
 - Fixed handling of extremely long paths inside tempnam() function. (Ilia)
+- Fixed bug #37635 (parameter of pcntl signal handler is trashed). (Mike)
 - Fixed bug #37632 (Protected method access problem). (Marcus)
-- Fixed bug #37616: DATE_RFC822 does not product RFC 822 dates. (Hannes
-  Magnusson, Derick)
 - Fixed bug #37620 (mysqli_ssl_set validation is innappropriate). (Georg)
+- Fixed bug #37616 (DATE_RFC822 does not product RFC 822 dates).
+  (Hannes Magnusson, Derick)
 - Fixed bug #37614 (Class name lowercased in error message). (Johannes)
 - Fixed bug #37587 (var without attribute causes segfault). (Marcus)
 - Fixed bug #37586 (Bumped minimum PCRE version to 6.6, needed for recursion
index 7705a287e0bc716631941e74655cefc413a6dded..8f18088948a72130ecc43bf779d17c87cf7465b2 100755 (executable)
@@ -693,16 +693,19 @@ void pcntl_tick_handler()
        PCNTL_G(head) = NULL; /* simple stores are atomic */
        
        /* Allocate */
-       MAKE_STD_ZVAL(param);
-       MAKE_STD_ZVAL(retval);
 
        while (queue) {
                if (zend_hash_index_find(&PCNTL_G(php_signal_table), queue->signo, (void **) &handle)==SUCCESS) {
+                       MAKE_STD_ZVAL(retval);
+                       MAKE_STD_ZVAL(param);
+                       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 TSRMLS_CC);
+                       zval_ptr_dtor(&param);
+                       zval_ptr_dtor(&retval);
                }
 
                next = queue->next;
@@ -713,10 +716,6 @@ void pcntl_tick_handler()
 
        /* Re-enable queue */
        PCNTL_G(processing_signal_queue) = 0;
-
-       /* Clean up */
-       efree(param);
-       efree(retval);
 }