]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Ratelimit: Fix formatting issue
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 27 Mar 2021 20:10:03 +0000 (20:10 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 27 Mar 2021 20:10:03 +0000 (20:10 +0000)
src/lua/lua_mempool.c
src/plugins/lua/reputation.lua

index 396f391700899825469b5298c94e47fc73f3822e..5f1fe46b3635e0ba13a632d1f95d541bd621d3c3 100644 (file)
@@ -524,8 +524,10 @@ lua_mempool_get_variable (lua_State *L)
 
                                return nvar;
                        }
-
-                       lua_pushstring (L, value);
+                       else {
+                               /* No type specified, return string */
+                               lua_pushstring(L, value);
+                       }
                }
                else {
                        lua_pushnil (L);
index 5ee16354b9c677c3edb07a14aed45ea87b0c136c..d846ece9a309cd2d608874e5032b9a18c3f9cf47 100644 (file)
@@ -411,19 +411,22 @@ local function ip_reputation_filter(task, rule)
     if asn_stats then
       local asn_score = generic_reputation_calc(asn_stats, rule, cfg.scores.asn, task)
       score = score + asn_score
-      table.insert(description_t, string.format('asn: %s(%.2f)', asn, asn_score))
+      table.insert(description_t, string.format('asn: %s(%.2f)',
+              asn, asn_score))
     end
     if country_stats then
       local country_score = generic_reputation_calc(country_stats, rule,
           cfg.scores.country, task)
       score = score + country_score
-      table.insert(description_t, string.format('country: %s(%.2f)', country, country_score))
+      table.insert(description_t, string.format('country: %s(%.2f)',
+              country, country_score))
     end
     if ip_stats then
       local ip_score = generic_reputation_calc(ip_stats, rule, cfg.scores.ip,
         task)
       score = score + ip_score
-      table.insert(description_t, string.format('ip: %s(%.2f)', ip, ip_score))
+      table.insert(description_t, string.format('ip: %s(%.2f)',
+              tostring(ip), ip_score))
     end
 
     if math.abs(score) > 0.001 then