diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-01-29 15:03:21 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-01-29 15:03:21 +0000 |
commit | c70985d47ed3635fe5bedda65e9178f04d84b94e (patch) | |
tree | b634cda9b27a2f582018e5f5c5866a01f06ef08d /src/libserver/composites.c | |
parent | 971025ceca5af31e11a1d079302365bb6f3d7f8c (diff) | |
download | rspamd-c70985d47ed3635fe5bedda65e9178f04d84b94e.tar.gz rspamd-c70985d47ed3635fe5bedda65e9178f04d84b94e.zip |
[Rework] Allow to add userdata as symbols options
Diffstat (limited to 'src/libserver/composites.c')
-rw-r--r-- | src/libserver/composites.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libserver/composites.c b/src/libserver/composites.c index 8471d0e93..22fe45818 100644 --- a/src/libserver/composites.c +++ b/src/libserver/composites.c @@ -251,7 +251,11 @@ rspamd_composite_process_single_symbol (struct composites_data *cd, DL_FOREACH (ms->opts_head, opt) { if (cur_opt->type == RSPAMD_COMPOSITE_OPTION_PLAIN) { - if (strcmp (opt->option, cur_opt->data.match) == 0) { + gsize mlen = strlen (cur_opt->data.match); + + if (opt->optlen == mlen && + memcmp (opt->option, cur_opt->data.match, mlen) == 0) { + found = true; break; @@ -259,7 +263,7 @@ rspamd_composite_process_single_symbol (struct composites_data *cd, } else { if (rspamd_regexp_match (cur_opt->data.re, - opt->option, 0, FALSE)) { + opt->option, opt->optlen, FALSE)) { found = true; break; |