From 41f5fe02575611ac43848a3a95f337e57960d492 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 6 Oct 2018 23:15:50 +0200 Subject: Bump coverage again --- src/sp_disabled_functions.c | 13 +++---------- src/sp_execute.c | 5 +++-- src/sp_unserialize.c | 4 ++-- src/sp_utils.c | 2 +- src/tests/disabled_functions.phpt | 3 ++- 5 files changed, 11 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c index 79dc5a7..b5cbe14 100644 --- a/src/sp_disabled_functions.c +++ b/src/sp_disabled_functions.c @@ -7,7 +7,7 @@ ZEND_DECLARE_MODULE_GLOBALS(snuffleupagus) char* get_complete_function_path(zend_execute_data const* const execute_data) { if (zend_is_executing() && !EG(current_execute_data)->func) { - return NULL; + return NULL; // LCOV_EXCL_LINE } if (!(execute_data->func->common.function_name)) { return NULL; @@ -259,7 +259,7 @@ bool should_disable_ht(zend_execute_data* execute_data, zend_string* current_filename; if (!execute_data) { - return false; + return false; // LCOV_EXCL_LINE } if (UNEXPECTED(builtin_param && !strcmp(function_name, "eval"))) { @@ -509,7 +509,6 @@ ZEND_FUNCTION(check_disabled_function) { SNUFFLEUPAGUS_G(config) .config_disabled_functions_reg->disabled_functions, SNUFFLEUPAGUS_G(config).config_disabled_functions_hooked)) { - zend_bailout(); } orig_handler = zend_hash_str_find_ptr( @@ -522,7 +521,6 @@ ZEND_FUNCTION(check_disabled_function) { .config_disabled_functions_reg_ret->disabled_functions, SNUFFLEUPAGUS_G(config).config_disabled_functions_ret_hooked, execute_data)) { - zend_bailout(); } } @@ -593,7 +591,6 @@ ZEND_FUNCTION(eval_blacklist_callback) { sp_log_msg("eval", SP_LOG_DROP, "A call to %s was tried in eval, in %s:%d, dropping it.", current_function_name, ZSTR_VAL(filename), line_number); - zend_bailout(); } efree(filename); } @@ -644,16 +641,12 @@ zend_write_func_t zend_write_default = NULL; int hook_echo(const char* str, size_t str_length) { zend_string* zs = zend_string_init(str, str_length, 0); - bool ret = should_disable_ht( + should_disable_ht( EG(current_execute_data), "echo", zs, NULL, SNUFFLEUPAGUS_G(config).config_disabled_functions_reg->disabled_functions, SNUFFLEUPAGUS_G(config).config_disabled_functions_hooked); zend_string_release(zs); - if (ret) { - zend_bailout(); - } - return zend_write_default(str, str_length); } diff --git a/src/sp_execute.c b/src/sp_execute.c index e631f7b..fa8fa90 100644 --- a/src/sp_execute.c +++ b/src/sp_execute.c @@ -223,8 +223,9 @@ static void sp_zend_execute_internal(INTERNAL_FUNCTION_PARAMETERS) { is_in_eval_and_whitelisted(execute_data); if (UNEXPECTED(NULL != orig_zend_execute_internal)) { - orig_zend_execute_internal( - INTERNAL_FUNCTION_PARAM_PASSTHRU); // LCOV_EXCL_LINE + // LCOV_EXCL_START + orig_zend_execute_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU); + // LCOV_EXCL_STOP } else { EX(func)->internal_function.handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); } diff --git a/src/sp_unserialize.c b/src/sp_unserialize.c index fe738e6..5e21d6a 100644 --- a/src/sp_unserialize.c +++ b/src/sp_unserialize.c @@ -97,8 +97,8 @@ PHP_FUNCTION(sp_unserialize) { } else { if (config_unserialize->dump) { sp_log_request(config_unserialize->dump, - config_unserialize->textual_representation, - SP_TOKEN_UNSERIALIZE_HMAC); + config_unserialize->textual_representation, + SP_TOKEN_UNSERIALIZE_HMAC); } if (true == config_unserialize->simulation) { sp_log_msg("unserialize", SP_LOG_SIMULATION, "Invalid HMAC for %s", diff --git a/src/sp_utils.c b/src/sp_utils.c index 3def6da..d6d8c00 100644 --- a/src/sp_utils.c +++ b/src/sp_utils.c @@ -183,7 +183,7 @@ const zend_string* sp_zval_to_zend_string(const zval* zv) { return zend_string_init("ARRAY", sizeof("ARRAY") - 1, 0); case IS_RESOURCE: return zend_string_init("RESOURCE", sizeof("RESOURCE") - 1, 0); - default: // LCOV_EXCL_LINE + default: // LCOV_EXCL_LINE return zend_string_init("", 0, 0); // LCOV_EXCL_LINE } } diff --git a/src/tests/disabled_functions.phpt b/src/tests/disabled_functions.phpt index 48d3724..6e57dba 100644 --- a/src/tests/disabled_functions.phpt +++ b/src/tests/disabled_functions.phpt @@ -6,6 +6,7 @@ Disable functions sp.configuration_file={PWD}/config/disabled_functions.ini --FILE-- --EXPECTF-- -Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'system' in %a/disabled_functions.php on line 2 \ No newline at end of file +Fatal error: [snuffleupagus][disabled_function] Aborted execution on call of the function 'system' in %a/disabled_functions.php on line %d -- cgit v1.3