From: Vsevolod Stakhov Date: Wed, 25 Aug 2021 16:12:28 +0000 (+0100) Subject: [Minor] Fix match_limit in pcre2 code X-Git-Tag: 3.1~220 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0632326add301a3be469ffa0fd48dd3178263c9b;p=rspamd.git [Minor] Fix match_limit in pcre2 code --- 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);