Skip to contentSkip to conversation

expression: incorrect assert() list_expr_to_binop

PATCH New Pablo Neira Ayuso 1 participant 1 message Mar 31, 2025 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 expression: incorrect assert() list_expr_to_binop

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")
---
 src/expression.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/expression.c +1 -1
index 228754fc2067..cc693b10d759 100644
@@ -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);
Signature · 1 line
2.30.2