Skip to content
Snippets Groups Projects
Commit c22d14ba authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "checkseapp: check the size of key value pairs"

parents b1dad096 eb74dd9f
No related branches found
No related tags found
No related merge requests found
...@@ -1128,6 +1128,9 @@ static void parse_file(file_info *in_file) { ...@@ -1128,6 +1128,9 @@ static void parse_file(file_info *in_file) {
if (!token) if (!token)
break; break;
if (token_cnt == KVP_NUM_OF_RULES)
goto oob;
} /*End token parsing */ } /*End token parsing */
rule_map *r = rule_map_new(keys, token_cnt, lineno, in_file->name, is_never_allow); rule_map *r = rule_map_new(keys, token_cnt, lineno, in_file->name, is_never_allow);
...@@ -1148,6 +1151,10 @@ err: ...@@ -1148,6 +1151,10 @@ err:
oom: oom:
log_error("In function %s: Out of memory\n", __FUNCTION__); log_error("In function %s: Out of memory\n", __FUNCTION__);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
oob:
log_error("Reading file: \"%s\" line: %zu reason: the size of key pairs exceeds the MAX(%zu)\n",
in_file->name, lineno, KVP_NUM_OF_RULES);
exit(EXIT_FAILURE);
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment