]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix text splitting: stack overflow (too many captures)
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 11 Nov 2017 15:25:54 +0000 (15:25 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 11 Nov 2017 15:25:54 +0000 (15:25 +0000)
MFH: rspamd-1.6

src/plugins/lua/phishing.lua

index cd228806755e9c680b8684c04e163502f791147f..e76ffc79aebbc37ff02e53e6d0d9382d5cca6890 100644 (file)
@@ -248,8 +248,8 @@ end
 local function rspamd_str_split_fun(s, sep, func)
   local lpeg = require "lpeg"
   sep = lpeg.P(sep)
-  local elem = lpeg.C((1 - sep)^0 / func)
-  local p = lpeg.C(elem * (sep * elem)^0)   -- make a table capture
+  local elem = lpeg.P((1 - sep)^0 / func)
+  local p = lpeg.P(elem * (sep * elem)^0)
   return p:match(s)
 end