diff options
| author | jvoisin | 2018-10-09 12:14:35 +0000 |
|---|---|---|
| committer | GitHub | 2018-10-09 12:14:35 +0000 |
| commit | b90387080a81952b330af225d4dc2bcbde14892d (patch) | |
| tree | 07cc273059b2d1cffb861b1a48debdcd6c8cc9f3 /src/sp_execute.c | |
| parent | 40cfba9328b9b27cfd2d2b66665780d9898cca2c (diff) | |
Don't check the return values of functions that might not return (#255)
This is due to our modifications to the logging system
Diffstat (limited to 'src/sp_execute.c')
| -rw-r--r-- | src/sp_execute.c | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/src/sp_execute.c b/src/sp_execute.c index cc2d9b7..544d8c2 100644 --- a/src/sp_execute.c +++ b/src/sp_execute.c | |||
| @@ -49,13 +49,10 @@ inline static void is_builtin_matching( | |||
| 49 | return; | 49 | return; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | if (true == | 52 | should_disable_ht( |
| 53 | should_disable_ht(EG(current_execute_data), function_name, param_value, | 53 | EG(current_execute_data), function_name, param_value, param_name, |
| 54 | param_name, | 54 | SNUFFLEUPAGUS_G(config).config_disabled_functions_reg->disabled_functions, |
| 55 | SNUFFLEUPAGUS_G(config) | 55 | ht); |
| 56 | .config_disabled_functions_reg->disabled_functions, | ||
| 57 | ht)) { | ||
| 58 | } | ||
| 59 | } | 56 | } |
| 60 | 57 | ||
| 61 | static void ZEND_HOT | 58 | static void ZEND_HOT |
| @@ -168,11 +165,9 @@ static void sp_execute_ex(zend_execute_data *execute_data) { | |||
| 168 | !execute_data->prev_execute_data->func || | 165 | !execute_data->prev_execute_data->func || |
| 169 | !ZEND_USER_CODE(execute_data->prev_execute_data->func->type) || | 166 | !ZEND_USER_CODE(execute_data->prev_execute_data->func->type) || |
| 170 | !execute_data->prev_execute_data->opline) { | 167 | !execute_data->prev_execute_data->opline) { |
| 171 | if (UNEXPECTED(true == should_disable_ht(execute_data, function_name, | 168 | should_disable_ht(execute_data, function_name, NULL, NULL, |
| 172 | NULL, NULL, | 169 | config_disabled_functions_reg, |
| 173 | config_disabled_functions_reg, | 170 | config_disabled_functions); |
| 174 | config_disabled_functions))) { | ||
| 175 | } | ||
| 176 | } else if ((execute_data->prev_execute_data->opline->opcode == | 171 | } else if ((execute_data->prev_execute_data->opline->opcode == |
| 177 | ZEND_DO_FCALL || | 172 | ZEND_DO_FCALL || |
| 178 | execute_data->prev_execute_data->opline->opcode == | 173 | execute_data->prev_execute_data->opline->opcode == |
| @@ -181,11 +176,9 @@ static void sp_execute_ex(zend_execute_data *execute_data) { | |||
| 181 | ZEND_DO_ICALL || | 176 | ZEND_DO_ICALL || |
| 182 | execute_data->prev_execute_data->opline->opcode == | 177 | execute_data->prev_execute_data->opline->opcode == |
| 183 | ZEND_DO_FCALL_BY_NAME)) { | 178 | ZEND_DO_FCALL_BY_NAME)) { |
| 184 | if (UNEXPECTED(true == should_disable_ht(execute_data, function_name, | 179 | should_disable_ht(execute_data, function_name, NULL, NULL, |
| 185 | NULL, NULL, | 180 | config_disabled_functions_reg, |
| 186 | config_disabled_functions_reg, | 181 | config_disabled_functions); |
| 187 | config_disabled_functions))) { | ||
| 188 | } | ||
| 189 | } | 182 | } |
| 190 | 183 | ||
| 191 | // When a function's return value isn't used, php doesn't store it in the | 184 | // When a function's return value isn't used, php doesn't store it in the |
| @@ -198,15 +191,11 @@ static void sp_execute_ex(zend_execute_data *execute_data) { | |||
| 198 | 191 | ||
| 199 | orig_execute_ex(execute_data); | 192 | orig_execute_ex(execute_data); |
| 200 | 193 | ||
| 201 | if (UNEXPECTED( | 194 | should_drop_on_ret_ht( |
| 202 | true == | 195 | EX(return_value), function_name, |
| 203 | should_drop_on_ret_ht( | 196 | SNUFFLEUPAGUS_G(config) |
| 204 | EX(return_value), function_name, | 197 | .config_disabled_functions_reg_ret->disabled_functions, |
| 205 | SNUFFLEUPAGUS_G(config) | 198 | SNUFFLEUPAGUS_G(config).config_disabled_functions_ret, execute_data); |
| 206 | .config_disabled_functions_reg_ret->disabled_functions, | ||
| 207 | SNUFFLEUPAGUS_G(config).config_disabled_functions_ret, | ||
| 208 | execute_data))) { | ||
| 209 | } | ||
| 210 | efree(function_name); | 199 | efree(function_name); |
| 211 | 200 | ||
| 212 | if (EX(return_value) == &ret_val) { | 201 | if (EX(return_value) == &ret_val) { |
