summaryrefslogtreecommitdiff
path: root/src/sp_var_parser.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_var_parser.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_var_parser.c')
-rw-r--r--src/sp_var_parser.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sp_var_parser.c b/src/sp_var_parser.c
index b57386e..72cbc12 100644
--- a/src/sp_var_parser.c
+++ b/src/sp_var_parser.c
@@ -31,7 +31,7 @@ static bool is_var_name_valid(const char *name) {
31 regexp_const = sp_pcre_compile(REGEXP_CONST); 31 regexp_const = sp_pcre_compile(REGEXP_CONST);
32 } 32 }
33 if (NULL == regexp_var || NULL == regexp_const) { 33 if (NULL == regexp_var || NULL == regexp_const) {
34 return false; 34 return false; // LCOV_EXCL_LINE
35 } 35 }
36 if ((false == sp_is_regexp_matching(regexp_var, name)) && 36 if ((false == sp_is_regexp_matching(regexp_var, name)) &&
37 (false == sp_is_regexp_matching(regexp_const, name))) { 37 (false == sp_is_regexp_matching(regexp_const, name))) {
@@ -64,8 +64,10 @@ static int create_var(sp_tree *tree, const char *restrict value,
64 var_node->type = VAR; 64 var_node->type = VAR;
65 } 65 }
66 if (!(var_node->value = pestrndup(value, value_len, 1))) { 66 if (!(var_node->value = pestrndup(value, value_len, 1))) {
67 // LCOV_EXCL_START
67 sp_log_err("config", "Can't allocate a strndup"); 68 sp_log_err("config", "Can't allocate a strndup");
68 return -1; 69 return -1;
70 // LCOV_EXCL_STOP
69 } 71 }
70 if (var_node->type != INTERPRETED_STRING && 72 if (var_node->type != INTERPRETED_STRING &&
71 !is_var_name_valid(var_node->value)) { 73 !is_var_name_valid(var_node->value)) {