diff mbox series

[nft,v2,03/14] JSON: Disallow non-array concat expression values

Message ID 20180528165109.15992-4-phil@nwl.cc
State Accepted
Delegated to: Pablo Neira
Headers show
Series JSON: Some minor schema changes | expand

Commit Message

Phil Sutter May 28, 2018, 4:50 p.m. UTC
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>
---
 src/parser_json.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/src/parser_json.c b/src/parser_json.c
index 993368f04ea4a..60929386be4da 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;