commit 5ccd1d0: [Minor] Try to fix issue with incorrect indexing in url_reputation

Vsevolod Stakhov vsevolod at rspamd.com
Tue Apr 12 20:49:03 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-04-12 21:45:02 +0100
URL: https://github.com/rspamd/rspamd/commit/5ccd1d0dd02e85220643473bf9757246fae4bf57 (HEAD -> master)

[Minor] Try to fix issue with incorrect indexing in url_reputation
Issue: #4139

---
 src/plugins/lua/reputation.lua | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/plugins/lua/reputation.lua b/src/plugins/lua/reputation.lua
index 192c8ce3f..1dce44faf 100644
--- a/src/plugins/lua/reputation.lua
+++ b/src/plugins/lua/reputation.lua
@@ -338,7 +338,8 @@ local function url_reputation_filter(task, rule)
 
       local result_request_match_tbl = {}
       -- XXX: ugly O(N^2) loop to match requests and responses
-      for result_k,_ in pairs(results) do
+      for _,res_pair in ipairs(results) do
+        local result_k = res_pair[1]
         for _, request_k in ipairs(url_keys) do
           if result_k:find(request_k) then
             result_request_match_tbl[result_k] = request_k


More information about the Commits mailing list