aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/re_cache.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-27 15:52:28 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-27 15:52:28 +0100
commitdfbcf2c23fba345278eb75b77e64938bec4d439d (patch)
tree8ddc70961a9ead263dd1e1d4773f00af9493af0c /src/libserver/re_cache.c
parent3da3ad2506b2326ca533b11b9ab8e2cebb92b63f (diff)
downloadrspamd-dfbcf2c23fba345278eb75b77e64938bec4d439d.tar.gz
rspamd-dfbcf2c23fba345278eb75b77e64938bec4d439d.zip
[Fix] Do not count images urls when checking url regexps for compatibility
Diffstat (limited to 'src/libserver/re_cache.c')
-rw-r--r--src/libserver/re_cache.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c
index 592cc31d4..617322926 100644
--- a/src/libserver/re_cache.c
+++ b/src/libserver/re_cache.c
@@ -1137,15 +1137,17 @@ rspamd_re_cache_exec_re (struct rspamd_task *task,
lenvec = g_malloc (sizeof (*lenvec) * cnt);
g_hash_table_iter_init (&it, MESSAGE_FIELD (task, urls));
i = 0;
+ raw = FALSE;
while (g_hash_table_iter_next (&it, &k, &v)) {
url = v;
in = url->string;
len = url->urllen;
- raw = FALSE;
- scvec[i] = (guchar *)in;
- lenvec[i++] = len;
+ if (len > 0 && !(url->flags & RSPAMD_URL_FLAG_IMAGE)) {
+ scvec[i] = (guchar *) in;
+ lenvec[i++] = len;
+ }
}
g_hash_table_iter_init (&it, MESSAGE_FIELD (task, emails));
@@ -1154,14 +1156,13 @@ rspamd_re_cache_exec_re (struct rspamd_task *task,
url = v;
in = url->string;
len = url->urllen;
- raw = FALSE;
- scvec[i] = (guchar *) in;
- lenvec[i++] = len;
+ if (len > 0 && !(url->flags & RSPAMD_URL_FLAG_IMAGE)) {
+ scvec[i] = (guchar *) in;
+ lenvec[i++] = len;
+ }
}
- g_assert (i == cnt);
-
ret = rspamd_re_cache_process_regexp_data (rt, re,
task, scvec, lenvec, i, raw);
msg_debug_re_task ("checking url regexp: %s -> %d",