]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix matching of the same patterns from different tries
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 16 Dec 2016 11:19:54 +0000 (11:19 +0000)
committerAndrew Lewis <nerf@judo.za.org>
Wed, 4 Jan 2017 11:38:17 +0000 (13:38 +0200)
MFH: true

src/plugins/lua/trie.lua

index cad28cde51377aaec7724e795c50a2a9e91f4482..876f2b0e2a729d972362d74f7f96e4345b9a44d2 100644 (file)
@@ -54,13 +54,14 @@ local function tries_callback(task)
     return function (idx, pos)
       local param = params[idx]
       local pattern = patterns[idx]
+      local pattern_idx = pattern .. tostring(idx) .. type
 
-      if param['multi'] or not matched[pattern] then
+      if param['multi'] or not matched[pattern_idx] then
         rspamd_logger.debugm(N, task, "<%1> matched pattern %2 at pos %3",
           task:get_message_id(), pattern, pos)
         task:insert_result(param['symbol'], 1.0, type)
         if not param['multi'] then
-          matched[pattern] = true
+          matched[pattern_idx] = true
         end
       end
     end