summaryrefslogtreecommitdiff
path: root/src/sp_disabled_functions.c
diff options
context:
space:
mode:
authorjvoisin2018-01-10 17:38:24 +0100
committerjvoisin2018-01-10 17:38:24 +0100
commit6f21bff1d40326f69bc3b75b1b83b03623180365 (patch)
tree09cc459ca549693d69f35098046d8ad64f3cde91 /src/sp_disabled_functions.c
parent773c9b94c6978ccd41c5a46f0d03448fd0c039a7 (diff)
Rework the priority of bl/wl in eval
Diffstat (limited to 'src/sp_disabled_functions.c')
-rw-r--r--src/sp_disabled_functions.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c
index fa9d625..07c8696 100644
--- a/src/sp_disabled_functions.c
+++ b/src/sp_disabled_functions.c
@@ -5,9 +5,7 @@
5 5
6ZEND_DECLARE_MODULE_GLOBALS(snuffleupagus) 6ZEND_DECLARE_MODULE_GLOBALS(snuffleupagus)
7 7
8 8char* get_complete_function_path(zend_execute_data const* const execute_data) {
9char* get_complete_function_path(
10 zend_execute_data const* const execute_data) {
11 if (zend_is_executing() && !EG(current_execute_data)->func) { 9 if (zend_is_executing() && !EG(current_execute_data)->func) {
12 return NULL; 10 return NULL;
13 } 11 }
@@ -469,6 +467,10 @@ ZEND_FUNCTION(eval_blacklist_callback) {
469 void (*orig_handler)(INTERNAL_FUNCTION_PARAMETERS); 467 void (*orig_handler)(INTERNAL_FUNCTION_PARAMETERS);
470 const char* current_function_name = get_active_function_name(TSRMLS_C); 468 const char* current_function_name = get_active_function_name(TSRMLS_C);
471 469
470 if (true == check_is_in_eval_whitelist(current_function_name)) {
471 goto whitelisted;
472 }
473
472 if (SNUFFLEUPAGUS_G(in_eval) > 0) { 474 if (SNUFFLEUPAGUS_G(in_eval) > 0) {
473 const char* filename = get_eval_filename(zend_get_executed_filename()); 475 const char* filename = get_eval_filename(zend_get_executed_filename());
474 const int line_number = zend_get_executed_lineno(TSRMLS_C); 476 const int line_number = zend_get_executed_lineno(TSRMLS_C);
@@ -484,6 +486,7 @@ ZEND_FUNCTION(eval_blacklist_callback) {
484 } 486 }
485 } 487 }
486 488
489whitelisted:
487 orig_handler = zend_hash_str_find_ptr( 490 orig_handler = zend_hash_str_find_ptr(
488 SNUFFLEUPAGUS_G(sp_eval_blacklist_functions_hook), current_function_name, 491 SNUFFLEUPAGUS_G(sp_eval_blacklist_functions_hook), current_function_name,
489 strlen(current_function_name)); 492 strlen(current_function_name));