Fix a crash when map is not specified, e.g. nft add rule x y snat ip addr . port to 1.1.1.1 . 22 Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> --- src/evaluate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/evaluate.c b/src/evaluate.c index cad65cfb7343..8c227eb11402 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -2924,6 +2924,9 @@ static int stmt_evaluate_nat_map(struct eval_ctx *ctx, struct stmt *stmt) if (expr_evaluate(ctx, &stmt->nat.addr)) return -1; + if (stmt->nat.addr->etype != EXPR_MAP) + return 0; + data = stmt->nat.addr->mappings->set->data; datatype_set(data, dtype); -- 2.20.1