aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-10 23:31:20 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-10 23:31:20 +0100
commitb90f502a92dd68c59e48154c086e272ed9064163 (patch)
tree2dfb886ae577282e82bf3a54a5d8179bc3859423
parentdfacc06c519b4fedb6260b2a3b8e789cf9137273 (diff)
downloadrspamd-b90f502a92dd68c59e48154c086e272ed9064163.tar.gz
rspamd-b90f502a92dd68c59e48154c086e272ed9064163.zip
Set re limit from regexp module.
-rw-r--r--src/libmime/mime_expressions.c8
-rw-r--r--src/plugins/regexp.c1
2 files changed, 3 insertions, 6 deletions
diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c
index 438d7347f..6152032a2 100644
--- a/src/libmime/mime_expressions.c
+++ b/src/libmime/mime_expressions.c
@@ -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)) {
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c
index 27cbf924f..59f5427df 100644
--- a/src/plugins/regexp.c
+++ b/src/plugins/regexp.c
@@ -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) {