From 7f615c8013e5e01893d2e3e4d10aeaa541663761 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 10 Sep 2019 14:35:57 +0100 Subject: [PATCH] [Minor] Fix nhits set in pcre fallback --- src/libutil/multipattern.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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); -- 2.39.5