summaryrefslogtreecommitdiff
path: root/src/sp_execute.c
diff options
context:
space:
mode:
authorxXx-caillou-xXx2018-07-13 15:59:19 +0200
committerjvoisin2018-07-13 13:59:19 +0000
commit050eefd845ed9a588a8c92ed10827b0669883145 (patch)
tree2dc5f970442ec8813af8f53e9d4f717da67da1b3 /src/sp_execute.c
parent7bd365ebc471409f85e6561f7da4f93d7017bfa4 (diff)
Reduce call to get_complete_function_path
Diffstat (limited to 'src/sp_execute.c')
-rw-r--r--src/sp_execute.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/sp_execute.c b/src/sp_execute.c
index 6e38c75..96d9d85 100644
--- a/src/sp_execute.c
+++ b/src/sp_execute.c
@@ -150,13 +150,20 @@ static void sp_execute_ex(zend_execute_data *execute_data) {
150 } 150 }
151 151
152 if (SNUFFLEUPAGUS_G(config).hook_execute) { 152 if (SNUFFLEUPAGUS_G(config).hook_execute) {
153 char* function_name = get_complete_function_path(execute_data);
154
155 if (!function_name) {
156 orig_execute_ex(execute_data);
157 return;
158 }
159
153 if (!execute_data->prev_execute_data || 160 if (!execute_data->prev_execute_data ||
154 !execute_data->prev_execute_data->func || 161 !execute_data->prev_execute_data->func ||
155 !ZEND_USER_CODE(execute_data->prev_execute_data->func->type) || 162 !ZEND_USER_CODE(execute_data->prev_execute_data->func->type) ||
156 !execute_data->prev_execute_data->opline) { 163 !execute_data->prev_execute_data->opline) {
157 if (UNEXPECTED(true == 164 if (UNEXPECTED(true ==
158 should_disable_ht( 165 should_disable_ht(
159 execute_data, NULL, NULL, NULL, 166 execute_data, function_name, NULL, NULL,
160 SNUFFLEUPAGUS_G(config) 167 SNUFFLEUPAGUS_G(config)
161 .config_disabled_functions_reg->disabled_functions, 168 .config_disabled_functions_reg->disabled_functions,
162 SNUFFLEUPAGUS_G(config).config_disabled_functions))) { 169 SNUFFLEUPAGUS_G(config).config_disabled_functions))) {
@@ -170,7 +177,7 @@ static void sp_execute_ex(zend_execute_data *execute_data) {
170 ZEND_DO_FCALL_BY_NAME)) { 177 ZEND_DO_FCALL_BY_NAME)) {
171 if (UNEXPECTED(true == 178 if (UNEXPECTED(true ==
172 should_disable_ht( 179 should_disable_ht(
173 execute_data, NULL, NULL, NULL, 180 execute_data, function_name, NULL, NULL,
174 SNUFFLEUPAGUS_G(config) 181 SNUFFLEUPAGUS_G(config)
175 .config_disabled_functions_reg->disabled_functions, 182 .config_disabled_functions_reg->disabled_functions,
176 SNUFFLEUPAGUS_G(config).config_disabled_functions))) { 183 SNUFFLEUPAGUS_G(config).config_disabled_functions))) {
@@ -183,12 +190,13 @@ static void sp_execute_ex(zend_execute_data *execute_data) {
183 if (UNEXPECTED( 190 if (UNEXPECTED(
184 true == 191 true ==
185 should_drop_on_ret_ht( 192 should_drop_on_ret_ht(
186 EX(return_value), execute_data, 193 EX(return_value), function_name,
187 SNUFFLEUPAGUS_G(config) 194 SNUFFLEUPAGUS_G(config)
188 .config_disabled_functions_reg_ret->disabled_functions, 195 .config_disabled_functions_reg_ret->disabled_functions,
189 SNUFFLEUPAGUS_G(config).config_disabled_functions_ret))) { 196 SNUFFLEUPAGUS_G(config).config_disabled_functions_ret))) {
190 sp_terminate(); 197 sp_terminate();
191 } 198 }
199 efree(function_name);
192 } else { 200 } else {
193 orig_execute_ex(execute_data); 201 orig_execute_ex(execute_data);
194 } 202 }