From: Vsevolod Stakhov Date: Sun, 9 Apr 2017 09:46:51 +0000 (+0100) Subject: [Minor] Filter bad utf8 subjects X-Git-Tag: 1.5.5~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=53a6f9ec822d73a83e7d1221aec1cafac8d16585;p=rspamd.git [Minor] Filter bad utf8 subjects --- 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)