aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-14 15:11:00 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-14 15:11:00 +0100
commit9a56acc7f91d27a35b7d05d5f4ad5ba989e98612 (patch)
tree99412ed5584ebe25ac75c2f0b10f28e01788b6d6
parent80b45e8b6d0d7696e11927102706dee19d18ae46 (diff)
downloadrspamd-9a56acc7f91d27a35b7d05d5f4ad5ba989e98612.tar.gz
rspamd-9a56acc7f91d27a35b7d05d5f4ad5ba989e98612.zip
[Fix] Fix hyperscan callback invocation
-rw-r--r--src/libutil/multipattern.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c
index 15c0d641b..b3e01330f 100644
--- a/src/libutil/multipattern.c
+++ b/src/libutil/multipattern.c
@@ -499,12 +499,14 @@ rspamd_multipattern_hs_cb (unsigned int id,
void *ud)
{
struct rspamd_multipattern_cbdata *cbd = ud;
- gint ret;
+ gint ret = 0;
- ret = cbd->cb (cbd->mp, id, from, to, cbd->in, cbd->len, cbd->ud);
+ if (to > 0) {
+ ret = cbd->cb (cbd->mp, id, from, to - 1, cbd->in, cbd->len, cbd->ud);
- cbd->nfound ++;
- cbd->ret = ret;
+ cbd->nfound ++;
+ cbd->ret = ret;
+ }
return ret;
}