diff options
| author | jvoisin | 2017-10-12 01:04:59 +0200 |
|---|---|---|
| committer | jvoisin | 2017-10-12 01:04:59 +0200 |
| commit | 4e98405c80d80b21f23b133f92f79b23aaac6bad (patch) | |
| tree | c1ebe318c599b38322fe24938e4168c1975483ce /src | |
| parent | 9d284d6d8d489d231d20c8eef0035bdf01a2cbfe (diff) | |
Fix minor gcc warnings with experimental options
`CFLAGS='-Wnull-dereference -Wlogical-op -Wshadow -Wjump-misses-init' make clean coverage`
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp_config_keywords.c | 6 | ||||
| -rw-r--r-- | src/sp_disabled_functions.c | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index e71463a..5e31c41 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c | |||
| @@ -40,7 +40,7 @@ static int get_construct_type(sp_disabled_function const *const df) { | |||
| 40 | } else if (df->r_function) { | 40 | } else if (df->r_function) { |
| 41 | if (true == is_regexp_matching(df->r_function, mapping[i].keys[j])) { | 41 | if (true == is_regexp_matching(df->r_function, mapping[i].keys[j])) { |
| 42 | return mapping[i].type; | 42 | return mapping[i].type; |
| 43 | } | 43 | } |
| 44 | } | 44 | } |
| 45 | } | 45 | } |
| 46 | } | 46 | } |
| @@ -96,13 +96,13 @@ int parse_readonly_exec(char *line) { | |||
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | int parse_global(char *line) { | 98 | int parse_global(char *line) { |
| 99 | sp_config_functions sp_config_global[] = { | 99 | sp_config_functions sp_config_funcs_global[] = { |
| 100 | {parse_str, SP_TOKEN_ENCRYPTION_KEY, | 100 | {parse_str, SP_TOKEN_ENCRYPTION_KEY, |
| 101 | &(SNUFFLEUPAGUS_G(config).config_snuffleupagus->encryption_key)}, | 101 | &(SNUFFLEUPAGUS_G(config).config_snuffleupagus->encryption_key)}, |
| 102 | {parse_str, SP_TOKEN_ENV_VAR, | 102 | {parse_str, SP_TOKEN_ENV_VAR, |
| 103 | &(SNUFFLEUPAGUS_G(config).config_snuffleupagus->cookies_env_var)}, | 103 | &(SNUFFLEUPAGUS_G(config).config_snuffleupagus->cookies_env_var)}, |
| 104 | {0}}; | 104 | {0}}; |
| 105 | return parse_keywords(sp_config_global, line); | 105 | return parse_keywords(sp_config_funcs_global, line); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | int parse_cookie_encryption(char *line) { | 108 | int parse_cookie_encryption(char *line) { |
diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c index c073b79..4ddb4af 100644 --- a/src/sp_disabled_functions.c +++ b/src/sp_disabled_functions.c | |||
| @@ -274,6 +274,7 @@ static bool should_drop_on_ret(zval* return_value, | |||
| 274 | char* complete_path_function = get_complete_function_path(execute_data); | 274 | char* complete_path_function = get_complete_function_path(execute_data); |
| 275 | const char* current_filename = zend_get_executed_filename(TSRMLS_C); | 275 | const char* current_filename = zend_get_executed_filename(TSRMLS_C); |
| 276 | char current_file_hash[SHA256_SIZE * 2] = {0}; | 276 | char current_file_hash[SHA256_SIZE * 2] = {0}; |
| 277 | bool match_type = false, match_value = false; | ||
| 277 | 278 | ||
| 278 | if (!complete_path_function) { | 279 | if (!complete_path_function) { |
| 279 | return false; | 280 | return false; |
| @@ -325,13 +326,13 @@ static bool should_drop_on_ret(zval* return_value, | |||
| 325 | 326 | ||
| 326 | ret_value_str = sp_convert_to_string(return_value); | 327 | ret_value_str = sp_convert_to_string(return_value); |
| 327 | 328 | ||
| 328 | bool match_type = (config_node->ret_type) && | 329 | match_type = (config_node->ret_type) && |
| 329 | (config_node->ret_type == Z_TYPE_P(return_value)); | 330 | (config_node->ret_type == Z_TYPE_P(return_value)); |
| 330 | bool match_value = (config_node->ret || config_node->r_ret) && | 331 | match_value = (config_node->ret || config_node->r_ret) && |
| 331 | (true == sp_match_value(ret_value_str, config_node->ret, | 332 | (true == sp_match_value(ret_value_str, config_node->ret, |
| 332 | config_node->r_ret)); | 333 | config_node->r_ret)); |
| 333 | 334 | ||
| 334 | if (true == match_type || match_value) { | 335 | if (true == match_type || true == match_value) { |
| 335 | if (true == config_node->allow) { | 336 | if (true == config_node->allow) { |
| 336 | efree(complete_path_function); | 337 | efree(complete_path_function); |
| 337 | efree(ret_value_str); | 338 | efree(ret_value_str); |
