commit 0632326: [Minor] Fix match_limit in pcre2 code

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Aug 25 16:14:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-08-25 17:12:28 +0100
URL: https://github.com/rspamd/rspamd/commit/0632326add301a3be469ffa0fd48dd3178263c9b (HEAD -> master)

[Minor] Fix match_limit in pcre2 code

---
 src/libutil/regexp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c
index 90920a95e..5b928bcb4 100644
--- a/src/libutil/regexp.c
+++ b/src/libutil/regexp.c
@@ -693,6 +693,10 @@ rspamd_regexp_search (const rspamd_regexp_t *re, const gchar *text, gsize len,
 		len = strlen (text);
 	}
 
+	if (re->match_limit > 0 && len > re->match_limit) {
+		len = re->match_limit;
+	}
+
 	if (end != NULL && *end != NULL) {
 		/* Incremental search */
 		mt = (*end);


More information about the Commits mailing list