diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-14 15:11:00 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-14 15:11:00 +0100 |
commit | 9a56acc7f91d27a35b7d05d5f4ad5ba989e98612 (patch) | |
tree | 99412ed5584ebe25ac75c2f0b10f28e01788b6d6 | |
parent | 80b45e8b6d0d7696e11927102706dee19d18ae46 (diff) | |
download | rspamd-9a56acc7f91d27a35b7d05d5f4ad5ba989e98612.tar.gz rspamd-9a56acc7f91d27a35b7d05d5f4ad5ba989e98612.zip |
[Fix] Fix hyperscan callback invocation
-rw-r--r-- | src/libutil/multipattern.c | 10 |
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; } |