diff options
author | Phil Sutter <phil@nwl.cc> | 2018-05-28 18:50:58 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-06-01 09:16:48 +0200 |
commit | b32e20c51028cef839f8f40e95673c320a930f2b (patch) | |
tree | 44a2453d6879eaae3725569e7565b85fe673e911 | |
parent | b85f8b8670260587ec2c78a1252109dddc0ffffe (diff) |
JSON: Disallow non-array concat expression values
Concat expressions with just a single element don't make sense, so
there's no point in supporting a shorter syntax for this.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | src/parser_json.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/parser_json.c b/src/parser_json.c index 993368f0..60929386 100644 --- a/src/parser_json.c +++ b/src/parser_json.c @@ -910,9 +910,7 @@ static struct expr *json_parse_concat_expr(struct json_ctx *ctx, json_t *value; size_t index; - if (json_is_object(root)) - return json_parse_primary_expr(ctx, root); - else if (!json_is_array(root)) { + if (!json_is_array(root)) { json_error(ctx, "Unexpected concat object type %s.", json_typename(root)); return NULL; |