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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 src/parser_json.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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;
-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux