X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=file.c;h=bc6b5a9fb573a45c63471fda82bf5671e4f00533;hp=85959729fe1e2370213b967854a180363901e4f6;hb=907e27f8019efcb7bc6ce95ade0733102587d2dd;hpb=ad92cae5b9be81c30f25ebc1cd6292b7a40889a9;ds=sidebyside diff --git a/file.c b/file.c index 8595972..bc6b5a9 100644 --- a/file.c +++ b/file.c @@ -342,7 +342,9 @@ static void uci_parse_config(struct uci_context *ctx, char **str) /* command string null-terminated by strtok */ *str += strlen(*str) + 1; - type = next_arg(ctx, str, true, true); + type = next_arg(ctx, str, true, false); + if (!uci_validate_str(type, false)) + uci_parse_error(ctx, type, "invalid character in field"); name = next_arg(ctx, str, false, true); assert_eol(ctx, str); @@ -674,10 +676,12 @@ int uci_commit(struct uci_context *ctx, struct uci_package **package, bool overw path = NULL; /* check for updated history, flush */ - uci_load_history(ctx, p, true); + if (!uci_load_history(ctx, p, true)) + goto done; } else { /* flush history */ - uci_load_history(ctx, NULL, true); + if (!uci_load_history(ctx, NULL, true)) + goto done; } }