* [PATCH nft] expression: incorrect assert() list_expr_to_binop
@ 2025-03-31 22:36 Pablo Neira Ayuso
0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2025-03-31 22:36 UTC (permalink / raw)
To: netfilter-devel; +Cc: fw
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>
---
src/expression.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/expression.c b/src/expression.c
index 228754fc2067..cc693b10d759 100644
--- a/src/expression.c
+++ b/src/expression.c
@@ -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);
--
2.30.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-03-31 22:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-31 22:36 [PATCH nft] expression: incorrect assert() list_expr_to_binop Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).