aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-08-25 17:12:28 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-08-25 17:12:28 +0100
commit0632326add301a3be469ffa0fd48dd3178263c9b (patch)
tree750c5b6fc95e2a468f9d112a0b199856a61a8295
parent9d809fc59320afe0304d2e7194a5a68067fb60d2 (diff)
downloadrspamd-0632326add301a3be469ffa0fd48dd3178263c9b.tar.gz
rspamd-0632326add301a3be469ffa0fd48dd3178263c9b.zip
[Minor] Fix match_limit in pcre2 code
-rw-r--r--src/libutil/regexp.c4
1 files changed, 4 insertions, 0 deletions
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);