From db27b848ddf754e84aec3b78c595dd331f47b083 Mon Sep 17 00:00:00 2001 From: Bastien Dejean Date: Mon, 5 Nov 2018 10:29:17 +0100 Subject: [PATCH] Don't crash when class_name is NULL Fixes #870. --- src/rule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rule.c b/src/rule.c index 2dc4a5d..61f6192 100644 --- a/src/rule.c +++ b/src/rule.c @@ -85,7 +85,7 @@ void remove_rule_by_cause(char *cause) char *instance_name = strtok(NULL, COL_TOK); while (r != NULL) { rule_t *next = r->next; - if ((streq(class_name, MATCH_ANY) || streq(r->class_name, class_name)) && + if ((class_name != NULL && (streq(class_name, MATCH_ANY) || streq(r->class_name, class_name))) && (instance_name == NULL || streq(instance_name, MATCH_ANY) || streq(r->instance_name, instance_name))) { remove_rule(r); }