From: Pablo Neira Ayuso Date: Mon, 10 May 2021 16:52:47 +0000 (+0200) Subject: evaluate: don't crash on set definition with incorrect datatype X-Git-Tag: v0.9.9~21 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=fa1d5b344a9b30d9071909e1d4cc3343ba45fc97;p=thirdparty%2Fnftables.git evaluate: don't crash on set definition with incorrect datatype Cache updates have resurrected the bug described in 5afa5a164ff1 ("evaluate: check for NULL datatype in rhs in lookup expr"). This is triggered by testcases/cache/0008_delete_by_handle_0. Fixes: df48e56e987f ("cache: add hashtable cache for sets") Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/evaluate.c b/src/evaluate.c index 95189180..2e31ed10 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -262,7 +262,7 @@ static int expr_evaluate_symbol(struct eval_ctx *ctx, struct expr **expr) return table_not_found(ctx); set = set_cache_find(table, (*expr)->identifier); - if (set == NULL) + if (set == NULL || !set->key) return set_not_found(ctx, &(*expr)->location, (*expr)->identifier);