summaryrefslogtreecommitdiff
path: root/suhosin7.c
diff options
context:
space:
mode:
authorBen Fuhrmannek2016-03-04 11:34:33 +0100
committerBen Fuhrmannek2016-03-04 11:34:33 +0100
commit3d8cc07c5af283289f62f0964f153804f2cc1862 (patch)
tree048e15e05ffd080fa1ad6752b0e893c62e83716e /suhosin7.c
parent60ba43075649da201339634ed071ccb274c96ec8 (diff)
fixed ZTS segfault (closes #4)
Diffstat (limited to 'suhosin7.c')
-rw-r--r--suhosin7.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/suhosin7.c b/suhosin7.c
index 42a058f..14b7fa0 100644
--- a/suhosin7.c
+++ b/suhosin7.c
@@ -27,17 +27,14 @@
27#include "php.h" 27#include "php.h"
28#include "php_ini.h" 28#include "php_ini.h"
29#include "SAPI.h" 29#include "SAPI.h"
30#include "php_suhosin7.h"
31#include "suhosin7_logo.h" 30#include "suhosin7_logo.h"
32#include "ext/standard/base64.h" 31#include "ext/standard/base64.h"
33#include "ext/standard/info.h" 32#include "ext/standard/info.h"
33#include "php_suhosin7.h"
34 34
35 35
36ZEND_DECLARE_MODULE_GLOBALS(suhosin7) 36ZEND_DECLARE_MODULE_GLOBALS(suhosin7)
37 37
38/* True global resources - no need for thread safety here */
39// static int le_suhosin7;
40
41/* ------------------------------------------------------------------------ */ 38/* ------------------------------------------------------------------------ */
42/* PERDIR CHECKS */ 39/* PERDIR CHECKS */
43#define PERDIR_CHECK(lower) \ 40#define PERDIR_CHECK(lower) \
@@ -449,6 +446,11 @@ char *suhosin_getenv(char *name, size_t name_len)
449 */ 446 */
450static void php_suhosin7_init_globals(zend_suhosin7_globals *suhosin7_globals) 447static void php_suhosin7_init_globals(zend_suhosin7_globals *suhosin7_globals)
451{ 448{
449 SDEBUG(".");
450#if defined(COMPILE_DL_SUHOSIN7) && defined(ZTS)
451 ZEND_TSRMLS_CACHE_UPDATE();
452#endif
453
452 memset(suhosin7_globals, 0, sizeof(zend_suhosin7_globals)); 454 memset(suhosin7_globals, 0, sizeof(zend_suhosin7_globals));
453} 455}
454/* }}} */ 456/* }}} */
@@ -540,6 +542,10 @@ PHP_MSHUTDOWN_FUNCTION(suhosin7)
540PHP_RINIT_FUNCTION(suhosin7) 542PHP_RINIT_FUNCTION(suhosin7)
541{ 543{
542 SDEBUG("(RINIT)"); 544 SDEBUG("(RINIT)");
545#if defined(COMPILE_DL_SUHOSIN7) && defined(ZTS)
546 ZEND_TSRMLS_CACHE_UPDATE();
547#endif
548
543 SUHOSIN7_G(in_code_type) = SUHOSIN_NORMAL; 549 SUHOSIN7_G(in_code_type) = SUHOSIN_NORMAL;
544 SUHOSIN7_G(execution_depth) = 0; 550 SUHOSIN7_G(execution_depth) = 0;
545 551