]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
JSON: Disallow non-array concat expression values
authorPhil Sutter <phil@nwl.cc>
Mon, 28 May 2018 16:50:58 +0000 (18:50 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 1 Jun 2018 07:16:48 +0000 (09:16 +0200)
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>
src/parser_json.c

index 993368f04ea4ad81cf6d7779e8a950b3f8f0ce6b..60929386be4da9524e5e524ef8ca3b93bba57af1 100644 (file)
@@ -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;