commit 7f615c8: [Minor] Fix nhits set in pcre fallback

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Sep 10 13:42:19 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-09-10 14:35:57 +0100
URL: https://github.com/rspamd/rspamd/commit/7f615c8013e5e01893d2e3e4d10aeaa541663761

[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);
 


More information about the Commits mailing list