Fix issue with zend signals in php_request_startup
authorHerman J. Radtke III <herman@hermanradtke.com>
Sat, 14 Oct 2017 17:50:30 +0000 (10:50 -0700)
committerJoe Watkins <krakjoe@php.net>
Thu, 19 Oct 2017 10:48:16 +0000 (11:48 +0100)
The zend_signals_activate() function is called in php_request_startup()
even if `--disable-zend-signals` is used. This causes uninitialized
variables to be used on ZTS builds.

This was removed in 7.1 in c870633. Removing guards from the SAPIs
should be fine, but removing the guard from main/main.c prevents anyone
using the static embedded library to integrate PHP into their programs.

For more details, see the "Additional remark" section in
https://bugs.php.net/bug.php?id=74149

main/main.c

index 37eae94d7b2ea860a10ffe66f8d5808737fb1875..a3a726eab2e242df73e83ead8c2e97e38b6518b2 100644 (file)
@@ -1662,7 +1662,9 @@ int php_request_startup(void)
                zend_activate();
                sapi_activate();
 
+#ifdef ZEND_SIGNALS
                zend_signal_activate();
+#endif
 
                if (PG(max_input_time) == -1) {
                        zend_set_timeout(EG(timeout_seconds), 1);