From: Vsevolod Stakhov Date: Sun, 5 Oct 2025 16:43:36 +0000 (+0100) Subject: [Fix] Use correct html_features field to fix compilation error X-Git-Tag: 3.14.0~87^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5792a5d625925ba10a977be32540f9e682f11188;p=thirdparty%2Frspamd.git [Fix] Use correct html_features field to fix compilation error The part->html->features path was incorrect since part->html is void*. Use the correct part->html_features field which is populated by rspamd_html_get_features() during message parsing. Also added NULL check for html_features before accessing its fields. --- diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 5c14f51711..467fb8de38 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -2266,10 +2266,16 @@ fuzzy_cmd_from_html_part(struct rspamd_task *task, return NULL; } + /* Check if HTML features are available */ + if (!part->html_features) { + msg_debug_fuzzy_check("HTML part has no features available"); + return NULL; + } + /* Check minimum tags threshold */ - if (part->html->features.tags_count < rule->min_html_tags) { + if (part->html_features->tags_count < rule->min_html_tags) { msg_debug_fuzzy_check("HTML part has %d tags, less than minimum %d", - part->html->features.tags_count, rule->min_html_tags); + part->html_features->tags_count, rule->min_html_tags); return NULL; } @@ -2278,14 +2284,14 @@ fuzzy_cmd_from_html_part(struct rspamd_task *task, * - Require at least 2 links (single-link emails too generic) * - Require at least some DOM depth (flat structure too common) */ - if (part->html->features.links.total_links < 2) { + if (part->html_features->links.total_links < 2) { msg_debug_fuzzy_check("HTML part has only %d links, too few for reliable matching", - part->html->features.links.total_links); + part->html_features->links.total_links); return NULL; } - if (part->html->features.max_dom_depth < 3) { + if (part->html_features->max_dom_depth < 3) { msg_debug_fuzzy_check("HTML part has depth %d, too shallow for reliable matching", - part->html->features.max_dom_depth); + part->html_features->max_dom_depth); return NULL; }