From 97f46740b498bbfe6ff58722356b2756d6568ed8 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 1 Apr 2025 09:49:48 +0200 Subject: [PATCH] parser_json: allow statement stateful statement only in set elements commit 85b5b051f0e64f106cee078fc6d66d0872770e79 upstream. Upfront reject of non stateful statements in set elements. Fixes: 07958ec53830 ("json: add set statement list support") Signed-off-by: Pablo Neira Ayuso --- src/parser_json.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/parser_json.c b/src/parser_json.c index c58a240a..799d0bd9 100644 --- a/src/parser_json.c +++ b/src/parser_json.c @@ -2344,6 +2344,11 @@ static void json_parse_set_stmt_list(struct json_ctx *ctx, stmt_list_free(stmt_list); return; } + if (!(stmt->flags & STMT_F_STATEFUL)) { + stmt_free(stmt); + json_error(ctx, "Unsupported set statements array at index %zd failed.", index); + stmt_list_free(stmt_list); + } list_add(&stmt->list, head); head = &stmt->list; } -- 2.47.3