diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-09 10:46:51 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-09 10:46:51 +0100 |
commit | 53a6f9ec822d73a83e7d1221aec1cafac8d16585 (patch) | |
tree | 019670267c7dca308cf62568c063e885ab252cf9 | |
parent | 61f3e49741fc9fe1e2fed075a704bb0ce5f6b4ba (diff) | |
download | rspamd-53a6f9ec822d73a83e7d1221aec1cafac8d16585.tar.gz rspamd-53a6f9ec822d73a83e7d1221aec1cafac8d16585.zip |
[Minor] Filter bad utf8 subjects
-rw-r--r-- | src/plugins/lua/history_redis.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/lua/history_redis.lua b/src/plugins/lua/history_redis.lua index 13e780e52..1564f467c 100644 --- a/src/plugins/lua/history_redis.lua +++ b/src/plugins/lua/history_redis.lua @@ -163,7 +163,13 @@ local function handle_history_request(task, conn, from, to, reset) -- Parse elements using ucl data = fun.totable( fun.map(function (_, obj) return obj end, - fun.filter(function(res, obj) if res then return true end end, + fun.filter(function(res, obj) + if res and (not obj.subject or + rspamd_util.is_valid_utf8(obj.subject)) then + return true + end + return false + end, fun.map(function(elt) local parser = ucl.parser() local res,_ = parser:parse_string(elt) |