summaryrefslogtreecommitdiff
path: root/src/sp_config_keywords.c
diff options
context:
space:
mode:
authorjvoisin2018-10-06 16:15:00 +0000
committerGitHub2018-10-06 16:15:00 +0000
commitaa550b9abadc109a2c89a7cd6dd047ac2a953027 (patch)
tree1892e9ce8f833f3f13278cd424368fe1b5e26d91 /src/sp_config_keywords.c
parent228fadf307b167a22ad6ec760f3b2ee2e9f2fee3 (diff)
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
Diffstat (limited to 'src/sp_config_keywords.c')
-rw-r--r--src/sp_config_keywords.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c
index 6bb7130..04a3f41 100644
--- a/src/sp_config_keywords.c
+++ b/src/sp_config_keywords.c
@@ -52,12 +52,11 @@ int parse_session(char *line) {
52 return -1; 52 return -1;
53 } else if (0 == 53 } else if (0 ==
54 (SNUFFLEUPAGUS_G(config).config_snuffleupagus->encryption_key)) { 54 (SNUFFLEUPAGUS_G(config).config_snuffleupagus->encryption_key)) {
55 sp_log_err( 55 sp_log_err("config",
56 "config", 56 "You're trying to use the session cookie encryption feature "
57 "You're trying to use the session cookie encryption feature " 57 "on line %zu without having set the `.secret_key` option in"
58 "on line %zu without having set the `.encryption_key` option in" 58 "`sp.global`: please set it first",
59 "`sp.global`: please set it first", 59 sp_line_no);
60 sp_line_no);
61 pefree(session, 0); 60 pefree(session, 0);
62 return -1; 61 return -1;
63 } 62 }
@@ -166,7 +165,6 @@ int parse_global(char *line) {
166} 165}
167 166
168static int parse_eval_filter_conf(char *line, sp_list_node **list) { 167static int parse_eval_filter_conf(char *line, sp_list_node **list) {
169 zend_string *rest = NULL;
170 sp_config_eval *eval = SNUFFLEUPAGUS_G(config).config_eval; 168 sp_config_eval *eval = SNUFFLEUPAGUS_G(config).config_eval;
171 169
172 sp_config_functions sp_config_funcs[] = { 170 sp_config_functions sp_config_funcs[] = {
@@ -183,9 +181,6 @@ static int parse_eval_filter_conf(char *line, sp_list_node **list) {
183 return ret; 181 return ret;
184 } 182 }
185 183
186 if (rest != NULL) {
187 pefree(rest, 1);
188 }
189 return SUCCESS; 184 return SUCCESS;
190} 185}
191 186
@@ -286,8 +281,7 @@ int parse_cookie(char *line) {
286 return -1; 281 return -1;
287 } 282 }
288 } 283 }
289 SNUFFLEUPAGUS_G(config) 284 SNUFFLEUPAGUS_G(config).config_cookie->cookies =
290 .config_cookie->cookies =
291 sp_list_insert(SNUFFLEUPAGUS_G(config).config_cookie->cookies, cookie); 285 sp_list_insert(SNUFFLEUPAGUS_G(config).config_cookie->cookies, cookie);
292 return SUCCESS; 286 return SUCCESS;
293} 287}
@@ -350,7 +344,7 @@ int parse_disabled_functions(char *line) {
350 if (X && Y) { \ 344 if (X && Y) { \
351 sp_log_err("config", \ 345 sp_log_err("config", \
352 "Invalid configuration line: 'sp.disabled_functions%s': " \ 346 "Invalid configuration line: 'sp.disabled_functions%s': " \
353 "'.%s' and '.%s' are mutually exclusive on line %zu", \ 347 "'.%s' and '.%s' are mutually exclusive on line %zu", \
354 line, STR1, STR2, sp_line_no); \ 348 line, STR1, STR2, sp_line_no); \
355 return 1; \ 349 return 1; \
356 } 350 }