From 8398c8cd8dc51abd8d39c8cbb32ff1f9d4987c5f Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Thu, 5 Oct 2023 17:37:06 +0200 Subject: [PATCH] Don't crash when reading spamfilters from tkldb that don't compile (anymore). For example, because of a different version of PCRE2, or because of the switch from non-UTF8 to UTF8 (or vice versa) which disallows certain byte sequences. --- src/modules/tkldb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/tkldb.c b/src/modules/tkldb.c index aa038522b..c8375a405 100644 --- a/src/modules/tkldb.c +++ b/src/modules/tkldb.c @@ -713,7 +713,8 @@ int read_tkldb(void) R_SAFE(unrealdb_read_int64(db, &v)); tkl->ptr.spamfilter->tkl_duration = v; - if (find_tkl_spamfilter(tkl->type, tkl->ptr.spamfilter->match->str, + if (!do_not_add && + find_tkl_spamfilter(tkl->type, tkl->ptr.spamfilter->match->str, tkl->ptr.spamfilter->action->action, tkl->ptr.spamfilter->target)) {