summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ex_imp.c8
-rw-r--r--execute.c2
-rw-r--r--memory_limit.c3
-rw-r--r--php_suhosin.h6
-rw-r--r--sha256.c8
-rw-r--r--suhosin.c6
-rw-r--r--suhosin_rfc1867.h2
-rw-r--r--ufilter.c6
8 files changed, 13 insertions, 28 deletions
diff --git a/ex_imp.c b/ex_imp.c
index 6256f35..441314d 100644
--- a/ex_imp.c
+++ b/ex_imp.c
@@ -668,10 +668,8 @@ zend_function_entry suhosin_ex_imp_functions[] = {
668}; 668};
669/* }}} */ 669/* }}} */
670 670
671void suhosin_hook_ex_imp() 671void suhosin_hook_ex_imp(TSRMLS_D)
672{ 672{
673 TSRMLS_FETCH();
674
675 /* replace the extract and import_request_variables functions */ 673 /* replace the extract and import_request_variables functions */
676 zend_hash_del(CG(function_table), "extract", sizeof("extract")); 674 zend_hash_del(CG(function_table), "extract", sizeof("extract"));
677#ifdef SUHOSIN_HAVE_IRV 675#ifdef SUHOSIN_HAVE_IRV
@@ -682,10 +680,6 @@ void suhosin_hook_ex_imp()
682#else 680#else
683 zend_register_functions(NULL, suhosin_ex_imp_functions, NULL, MODULE_PERSISTENT TSRMLS_CC); 681 zend_register_functions(NULL, suhosin_ex_imp_functions, NULL, MODULE_PERSISTENT TSRMLS_CC);
684#endif 682#endif
685
686
687
688
689} 683}
690 684
691 685
diff --git a/execute.c b/execute.c
index a27d82f..ee8447e 100644
--- a/execute.c
+++ b/execute.c
@@ -1677,7 +1677,7 @@ internal_function_handler ihandlers[] = {
1677#define FUNCTION_WARNING() zend_error(E_WARNING, "%s() has been disabled for security reasons", get_active_function_name(TSRMLS_C)); 1677#define FUNCTION_WARNING() zend_error(E_WARNING, "%s() has been disabled for security reasons", get_active_function_name(TSRMLS_C));
1678#define FUNCTION_SIMULATE_WARNING() zend_error(E_WARNING, "SIMULATION - %s() has been disabled for security reasons", get_active_function_name(TSRMLS_C)); 1678#define FUNCTION_SIMULATE_WARNING() zend_error(E_WARNING, "SIMULATION - %s() has been disabled for security reasons", get_active_function_name(TSRMLS_C));
1679 1679
1680/* {{{ void suhosin_execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC) 1680/* {{{ void suhosin_execute_internal
1681 * This function provides a hook for internal execution */ 1681 * This function provides a hook for internal execution */
1682#if PHP_VERSION_ID >= 50500 1682#if PHP_VERSION_ID >= 50500
1683#define EX_T(offset) (*EX_TMP_VAR(execute_data_ptr, offset)) 1683#define EX_T(offset) (*EX_TMP_VAR(execute_data_ptr, offset))
diff --git a/memory_limit.c b/memory_limit.c
index 6a6b975..be05773 100644
--- a/memory_limit.c
+++ b/memory_limit.c
@@ -74,10 +74,9 @@ static PHP_INI_MH(suhosin_OnChangeMemoryLimit)
74/* }}} */ 74/* }}} */
75 75
76 76
77void suhosin_hook_memory_limit() 77void suhosin_hook_memory_limit(TSRMLS_D)
78{ 78{
79 zend_ini_entry *ini_entry; 79 zend_ini_entry *ini_entry;
80 TSRMLS_FETCH();
81 80
82 /* check if we are compiled against memory_limit */ 81 /* check if we are compiled against memory_limit */
83 if (zend_hash_find(EG(ini_directives), "memory_limit", sizeof("memory_limit"), (void **) &ini_entry)==FAILURE) { 82 if (zend_hash_find(EG(ini_directives), "memory_limit", sizeof("memory_limit"), (void **) &ini_entry)==FAILURE) {
diff --git a/php_suhosin.h b/php_suhosin.h
index 28a88eb..7129e49 100644
--- a/php_suhosin.h
+++ b/php_suhosin.h
@@ -433,10 +433,10 @@ void suhosin_hook_header_handler();
433void suhosin_unhook_header_handler(); 433void suhosin_unhook_header_handler();
434void suhosin_hook_session(TSRMLS_D); 434void suhosin_hook_session(TSRMLS_D);
435void suhosin_unhook_session(TSRMLS_D); 435void suhosin_unhook_session(TSRMLS_D);
436void suhosin_hook_sha256(); 436void suhosin_hook_sha256(TSRMLS_D);
437void suhosin_hook_ex_imp(); 437void suhosin_hook_ex_imp(TSRMLS_D);
438void suhosin_hook_treat_data(); 438void suhosin_hook_treat_data();
439void suhosin_hook_memory_limit(); 439void suhosin_hook_memory_limit(TSRMLS_D);
440void suhosin_hook_execute(TSRMLS_D); 440void suhosin_hook_execute(TSRMLS_D);
441void suhosin_unhook_execute(); 441void suhosin_unhook_execute();
442void suhosin_aes_gentables(); 442void suhosin_aes_gentables();
diff --git a/sha256.c b/sha256.c
index 7f542f3..275dccd 100644
--- a/sha256.c
+++ b/sha256.c
@@ -402,10 +402,8 @@ static zend_function_entry suhosin_sha256_functions[] = {
402/* }}} */ 402/* }}} */
403 403
404 404
405void suhosin_hook_sha256() 405void suhosin_hook_sha256(TSRMLS_D)
406{ 406{
407 TSRMLS_FETCH();
408
409 /* check if we already have sha256 support */ 407 /* check if we already have sha256 support */
410 if (zend_hash_exists(CG(function_table), "sha256", sizeof("sha256"))) { 408 if (zend_hash_exists(CG(function_table), "sha256", sizeof("sha256"))) {
411 return; 409 return;
@@ -417,10 +415,6 @@ void suhosin_hook_sha256()
417#else 415#else
418 zend_register_functions(NULL, suhosin_sha256_functions, NULL, MODULE_PERSISTENT TSRMLS_CC); 416 zend_register_functions(NULL, suhosin_sha256_functions, NULL, MODULE_PERSISTENT TSRMLS_CC);
419#endif 417#endif
420
421
422
423
424} 418}
425 419
426 420
diff --git a/suhosin.c b/suhosin.c
index 181f702..3071bc1 100644
--- a/suhosin.c
+++ b/suhosin.c
@@ -1046,9 +1046,9 @@ PHP_MINIT_FUNCTION(suhosin)
1046 } 1046 }
1047 1047
1048 /* now hook a bunch of stuff */ 1048 /* now hook a bunch of stuff */
1049 suhosin_hook_memory_limit(); 1049 suhosin_hook_memory_limit(TSRMLS_C);
1050 suhosin_hook_sha256(); 1050 suhosin_hook_sha256(TSRMLS_C);
1051 suhosin_hook_ex_imp(); 1051 suhosin_hook_ex_imp(TSRMLS_C);
1052 1052
1053#if PHP_VERSION_ID < 50500 1053#if PHP_VERSION_ID < 50500
1054 /* register the logo for phpinfo */ 1054 /* register the logo for phpinfo */
diff --git a/suhosin_rfc1867.h b/suhosin_rfc1867.h
index b4fdea0..192089c 100644
--- a/suhosin_rfc1867.h
+++ b/suhosin_rfc1867.h
@@ -78,7 +78,7 @@ typedef struct _multipart_event_end {
78 78
79SAPI_POST_HANDLER_FUNC(suhosin_rfc1867_post_handler); 79SAPI_POST_HANDLER_FUNC(suhosin_rfc1867_post_handler);
80 80
81void destroy_uploaded_files_hash(TSRMLS_D); 81// void destroy_uploaded_files_hash(TSRMLS_D);
82extern PHP_SUHOSIN_API int (*old_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC); 82extern PHP_SUHOSIN_API int (*old_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC);
83#if !HAVE_RFC1867_CALLBACK 83#if !HAVE_RFC1867_CALLBACK
84extern PHP_SUHOSIN_API int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC); 84extern PHP_SUHOSIN_API int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC);
diff --git a/ufilter.c b/ufilter.c
index b6c5986..1110e7c 100644
--- a/ufilter.c
+++ b/ufilter.c
@@ -32,7 +32,6 @@
32#include "suhosin_rfc1867.h" 32#include "suhosin_rfc1867.h"
33#include "ext/standard/php_var.h" 33#include "ext/standard/php_var.h"
34 34
35PHP_SUHOSIN_API int (*old_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC) = NULL;
36#if !HAVE_RFC1867_CALLBACK 35#if !HAVE_RFC1867_CALLBACK
37PHP_SUHOSIN_API int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC) = NULL; 36PHP_SUHOSIN_API int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC) = NULL;
38#endif 37#endif
@@ -40,11 +39,10 @@ PHP_SUHOSIN_API int (*php_rfc1867_callback)(unsigned int event, void *event_data
40 39
41/* {{{ SAPI_UPLOAD_VARNAME_FILTER_FUNC 40/* {{{ SAPI_UPLOAD_VARNAME_FILTER_FUNC
42 */ 41 */
43static int check_fileupload_varname(char *varname) 42static int check_fileupload_varname(char *varname TSRMLS_DC)
44{ 43{
45 char *index, *prev_index = NULL, *var; 44 char *index, *prev_index = NULL, *var;
46 unsigned int var_len, total_len, depth = 0; 45 unsigned int var_len, total_len, depth = 0;
47 TSRMLS_FETCH();
48 46
49 var = estrdup(varname); 47 var = estrdup(varname);
50 48
@@ -226,7 +224,7 @@ int suhosin_rfc1867_filter(unsigned int event, void *event_data, void **extra TS
226 } 224 }
227 225
228 226
229 if (check_fileupload_varname(mefs->name) == FAILURE) { 227 if (check_fileupload_varname(mefs->name TSRMLS_CC) == FAILURE) {
230 goto continue_with_failure; 228 goto continue_with_failure;
231 } 229 }
232 } 230 }