Skip to contentSkip to conversation

evaluate: don't crash on set definition with incorrect datatype

PATCH New Pablo Neira Ayuso 1 participant 1 message May 10, 2021 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 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")
---
 src/evaluate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/evaluate.c +1 -1
index e91d5236564e..75983b3c7a6a 100644
@@ -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);
 
Signature · 1 line
2.30.2