Skip to content

Commit

Permalink
lib: monkey: rconf: do not allow empty values after trim
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Dec 22, 2017
1 parent abb2dfe commit 5678138
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/monkey/mk_core/mk_rconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,10 @@ static int mk_rconf_read(struct mk_rconf *conf, const char *path)
mk_string_trim(&key);
mk_string_trim(&val);

if (strlen(val) == 0) {
mk_config_error(path, line, "Key has an empty value");
}

/* Register entry: key and val are copied as duplicated */
mk_rconf_section_entry_add(conf, key, val);

Expand Down

0 comments on commit 5678138

Please sign in to comment.