summaryrefslogtreecommitdiff
path: root/src/sp_disabled_functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp_disabled_functions.c')
-rw-r--r--src/sp_disabled_functions.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c
index 95e19ad..10a9466 100644
--- a/src/sp_disabled_functions.c
+++ b/src/sp_disabled_functions.c
@@ -16,7 +16,7 @@ char* get_complete_function_path(zend_execute_data const* const execute_data) {
16 if (!execute_data) { 16 if (!execute_data) {
17 return NULL; // LCOV_EXCL_LINE 17 return NULL; // LCOV_EXCL_LINE
18 } 18 }
19 zend_function *func = execute_data->func; 19 const zend_function *const func = execute_data->func;
20 if (!(func->common.function_name)) { 20 if (!(func->common.function_name)) {
21 return NULL; 21 return NULL;
22 } 22 }
@@ -25,7 +25,7 @@ char* get_complete_function_path(zend_execute_data const* const execute_data) {
25 char* complete_path_function = NULL; 25 char* complete_path_function = NULL;
26 26
27 if ((func->type == ZEND_USER_FUNCTION || func->type == ZEND_INTERNAL_FUNCTION) && func->common.scope) { 27 if ((func->type == ZEND_USER_FUNCTION || func->type == ZEND_INTERNAL_FUNCTION) && func->common.scope) {
28 char const* class_name = ZSTR_VAL(func->common.scope->name); 28 const char *const class_name = ZSTR_VAL(func->common.scope->name);
29 const size_t len = strlen(class_name) + 2 + strlen(function_name) + 1; 29 const size_t len = strlen(class_name) + 2 + strlen(function_name) + 1;
30 complete_path_function = emalloc(len); 30 complete_path_function = emalloc(len);
31 snprintf(complete_path_function, len, "%s::%s", class_name, function_name); 31 snprintf(complete_path_function, len, "%s::%s", class_name, function_name);
@@ -515,7 +515,11 @@ ZEND_FUNCTION(eval_blacklist_callback) {
515 zif_handler orig_handler; 515 zif_handler orig_handler;
516 char* current_function_name = get_complete_function_path(EG(current_execute_data)); 516 char* current_function_name = get_complete_function_path(EG(current_execute_data));
517 517
518 if (!current_function_name || true == check_is_in_eval_whitelist(current_function_name)) { 518 if (!current_function_name) {
519 return;
520 }
521
522 if( true == check_is_in_eval_whitelist(current_function_name)) {
519 goto whitelisted; 523 goto whitelisted;
520 } 524 }
521 525