From: Phil Sutter Date: Mon, 28 May 2018 16:50:58 +0000 (+0200) Subject: JSON: Disallow non-array concat expression values X-Git-Tag: v0.9.0~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b32e20c51028cef839f8f40e95673c320a930f2b;p=thirdparty%2Fnftables.git 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 Signed-off-by: Pablo Neira Ayuso --- 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;