]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix match_limit in pcre2 code
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 25 Aug 2021 16:12:28 +0000 (17:12 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 25 Aug 2021 16:12:28 +0000 (17:12 +0100)
src/libutil/regexp.c

index 90920a95eacd8e1f6a5abf7ee822e4bbe2608280..5b928bcb4a7058f1e72baa4afe0a0bbf22ff3a33 100644 (file)
@@ -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);