diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-11-08 14:51:46 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-11-08 14:51:46 +0000 |
commit | e6d7103b9e5496e9628df7b1367c326133b13809 (patch) | |
tree | fadad8b2f0e486dcf588a51bfed038870e0e1fb0 /src/libmime | |
parent | c203493c90484c9fba6102338a63c36e62511718 (diff) | |
download | rspamd-e6d7103b9e5496e9628df7b1367c326133b13809.tar.gz rspamd-e6d7103b9e5496e9628df7b1367c326133b13809.zip |
[Minor] Fix unit tests
Diffstat (limited to 'src/libmime')
-rw-r--r-- | src/libmime/message.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c index 0c11f5075..3acc935e6 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -654,9 +654,10 @@ rspamd_check_gtube(struct rspamd_task *task, struct rspamd_mime_text_part *part) static const gsize max_check_size = 8 * 1024; gint ret; enum rspamd_action_type act = METRIC_ACTION_NOACTION; + enum rspamd_gtube_patterns_policy policy = task->cfg ? task->cfg->gtube_patterns_policy : RSPAMD_GTUBE_REJECT; g_assert(part != NULL); - if (gtube_matcher == NULL && task->cfg->gtube_patterns_policy != RSPAMD_GTUBE_DISABLED) { + if (gtube_matcher == NULL && policy != RSPAMD_GTUBE_DISABLED) { gtube_matcher = rspamd_multipattern_create(RSPAMD_MULTIPATTERN_DEFAULT); rspamd_multipattern_add_pattern(gtube_matcher, @@ -684,7 +685,7 @@ rspamd_check_gtube(struct rspamd_task *task, struct rspamd_mime_text_part *part) if (part->utf_content.len >= sizeof(gtube_pattern_reject) && part->utf_content.len <= max_check_size && - task->cfg->gtube_patterns_policy != RSPAMD_GTUBE_DISABLED) { + policy != RSPAMD_GTUBE_DISABLED) { if ((ret = rspamd_multipattern_lookup(gtube_matcher, part->utf_content.begin, part->utf_content.len, rspamd_multipattern_gtube_cb, task, NULL)) > 0) { |