From aa550b9abadc109a2c89a7cd6dd047ac2a953027 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 6 Oct 2018 16:15:00 +0000 Subject: Bump a bit the coverage * `setcookie` doesn't always return `true` anymore * clang-format * Cookies with invalid decryption are dropped, but the request isn't anymore * faulty unserialize are now dumpable--- src/sp_wrapper.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/sp_wrapper.c') diff --git a/src/sp_wrapper.c b/src/sp_wrapper.c index e336a87..fd47dd6 100644 --- a/src/sp_wrapper.c +++ b/src/sp_wrapper.c @@ -7,11 +7,11 @@ static bool wrapper_is_whitelisted(const zend_string *zs) { const sp_list_node *list = SNUFFLEUPAGUS_G(config).config_wrapper->whitelist; if (!zs) { - return false; + return false; // LCOV_EXCL_LINE } while (list) { - if (zend_string_equals_ci(zs, (const zend_string*)list->data)) { + if (zend_string_equals_ci(zs, (const zend_string *)list->data)) { return true; } list = list->next; @@ -41,23 +41,24 @@ void sp_disable_wrapper() { zend_hash_destroy(orig_complete); pefree(orig_complete, 1); - SNUFFLEUPAGUS_G(config).config_wrapper->num_wrapper = zend_hash_num_elements(orig); + SNUFFLEUPAGUS_G(config).config_wrapper->num_wrapper = + zend_hash_num_elements(orig); } PHP_FUNCTION(sp_stream_wrapper_register) { zif_handler orig_handler; zend_string *protocol_name = NULL; - // LCOV_EXCL_BR_START + // LCOV_EXCL_BR_START ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_QUIET, 2, EX_NUM_ARGS()); Z_PARAM_STR(protocol_name); ZEND_PARSE_PARAMETERS_END_EX((void)0); - // LCOV_EXCL_BR_END + // LCOV_EXCL_BR_END if (wrapper_is_whitelisted(protocol_name)) { orig_handler = zend_hash_str_find_ptr( - SNUFFLEUPAGUS_G(sp_internal_functions_hook), - "stream_wrapper_register", sizeof("stream_wrapper_register") - 1); + SNUFFLEUPAGUS_G(sp_internal_functions_hook), "stream_wrapper_register", + sizeof("stream_wrapper_register") - 1); orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); } } -- cgit v1.3