From 77bd7e0c70d9a1914c4a853e09849af724c0f695 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 5 Oct 2022 01:36:44 +0200 Subject: evaluate: bogus datatype assertion in binary operation evaluation Use datatype_equal(), otherwise dynamically allocated datatype fails to fulfill the datatype pointer check, triggering the assertion: nft: evaluate.c:1249: expr_evaluate_binop: Assertion `expr_basetype(left) == expr_basetype(right)' failed. Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1636 Signed-off-by: Pablo Neira Ayuso --- src/evaluate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/evaluate.c') diff --git a/src/evaluate.c b/src/evaluate.c index a52867b3..2e2b8df0 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -1265,7 +1265,7 @@ static int expr_evaluate_binop(struct eval_ctx *ctx, struct expr **expr) sym, expr_name(right)); /* The grammar guarantees this */ - assert(expr_basetype(left) == expr_basetype(right)); + assert(datatype_equal(expr_basetype(left), expr_basetype(right))); switch (op->op) { case OP_LSHIFT: -- cgit v1.2.3