]> source.dussan.org Git - rspamd.git/commitdiff
Set re limit from regexp module.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 10 May 2015 22:31:20 +0000 (23:31 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 10 May 2015 22:31:20 +0000 (23:31 +0100)
src/libmime/mime_expressions.c
src/plugins/regexp.c

index 438d7347fcb29d1020c506c3663b0b6f207dcffb..6152032a25a5810ae66419e7f0c39c18411ea278 100644 (file)
@@ -728,12 +728,8 @@ rspamd_mime_regexp_element_process (struct rspamd_task *task,
                len = strlen (data);
        }
 
-       if (max_re_data != 0 && len > max_re_data) {
-               msg_info ("<%s> skip data of size %Hud",
-                                                       task->message_id,
-                                                       len);
-
-               return 0;
+       if (max_re_data > 0 && len > max_re_data) {
+               len = max_re_data;
        }
 
        while (rspamd_regexp_search (re->regexp, data, len, &start, &end, raw)) {
index 27cbf924f2b812c8fced7f6919e5a74cdff1a833..59f5427df17d4e7fb402268e5172f4a267713b3f 100644 (file)
@@ -126,6 +126,7 @@ regexp_module_config (struct rspamd_config *cfg)
                if (g_ascii_strncasecmp (ucl_object_key (value), "max_size",
                        sizeof ("max_size") - 1) == 0) {
                        regexp_module_ctx->max_size = ucl_obj_toint (value);
+                       rspamd_mime_expression_set_re_limit (regexp_module_ctx->max_size);
                }
                else if (g_ascii_strncasecmp (ucl_object_key (value), "max_threads",
                        sizeof ("max_threads") - 1) == 0) {