]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Add RSPAMD_MULTIPATTERN_TLD flag to search_trie_full creation
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 5 Jan 2026 14:58:23 +0000 (14:58 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 5 Jan 2026 14:58:23 +0000 (14:58 +0000)
The TLD flag must be present at multipattern creation time for the
ACISM fallback to work. Without this flag, mp->pats array is not
created and ACISM patterns are not stored, causing fallback to fail
when Hyperscan cache is not available.

src/libserver/url.c

index 26d3b310a7aff4f78bf7cea9b0058e7166b6ea90..ebd8e5903aa1b71b38ca6681e8b82841b3936b9a 100644 (file)
@@ -567,7 +567,7 @@ void rspamd_url_init(const char *tld_file)
                url_scanner->matchers_full = g_array_sized_new(FALSE, TRUE,
                                                                                                           sizeof(struct url_matcher), 13000);
                url_scanner->search_trie_full = rspamd_multipattern_create_sized(13000,
-                                                                                                                                                RSPAMD_MULTIPATTERN_ICASE | RSPAMD_MULTIPATTERN_UTF8);
+                                                                                                                                                RSPAMD_MULTIPATTERN_TLD | RSPAMD_MULTIPATTERN_ICASE | RSPAMD_MULTIPATTERN_UTF8);
        }
        else {
                url_scanner->matchers_full = NULL;