aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/multipattern.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-10 14:35:57 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-10 14:35:57 +0100
commit7f615c8013e5e01893d2e3e4d10aeaa541663761 (patch)
tree1c62973107c7963efe43a87cfe7f25de68fb76d7 /src/libutil/multipattern.c
parentac594f21c5a74f32464285aad9106cfb31c0a63f (diff)
downloadrspamd-7f615c8013e5e01893d2e3e4d10aeaa541663761.tar.gz
rspamd-7f615c8013e5e01893d2e3e4d10aeaa541663761.zip
[Minor] Fix nhits set in pcre fallback
Diffstat (limited to 'src/libutil/multipattern.c')
-rw-r--r--src/libutil/multipattern.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c
index 0fc028969..7e812a0bd 100644
--- a/src/libutil/multipattern.c
+++ b/src/libutil/multipattern.c
@@ -663,11 +663,20 @@ rspamd_multipattern_lookup (struct rspamd_multipattern *mp,
&end,
TRUE,
NULL)) {
- ret = rspamd_multipattern_acism_cb (i, end - in, &cbd);
+ if (rspamd_multipattern_acism_cb (i, end - in, &cbd)) {
+ goto out;
+ }
}
}
+out:
+ ret = cbd.ret;
+
+ if (pnfound) {
+ *pnfound = cbd.nfound;
+ }
}
else {
+ /* Plain trie */
ret = acism_lookup (mp->t, in, len, rspamd_multipattern_acism_cb, &cbd,
&state, mp->flags & RSPAMD_MULTIPATTERN_ICASE);