]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
expression: incorrect assert() list_expr_to_binop
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 31 Mar 2025 22:36:27 +0000 (00:36 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 1 Apr 2025 14:08:47 +0000 (16:08 +0200)
assert() logic is reversed, all expressions in the list are handled,
including the first.

  src/expression.c:1285: list_expr_to_binop: Assertion `first' failed.

Fixes: 53d6bb992445 ("expression: initialize list of expression to silence gcc compile warning")
Reported-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
src/expression.c

index 9f19a379df0f5c89f0241c22303963590e5a5016..dc9a44677b28e8ec3148ec86ec92af60cd09c1da 100644 (file)
@@ -1282,7 +1282,7 @@ struct expr *list_expr_to_binop(struct expr *expr)
                }
        }
        /* list with one single item only, this should not happen. */
-       assert(first);
+       assert(!first);
 
        /* zap list expressions, they have been moved to binop expression. */
        init_list_head(&expr->expressions);