commit 64772cf: [Rules] Fix pay-to-hash addresses validation

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Apr 12 11:42:05 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-04-12 12:35:08 +0100
URL: https://github.com/rspamd/rspamd/commit/64772cf0e77038981f30f6310e048c0506a441d5

[Rules] Fix pay-to-hash addresses validation

---
 rules/regexp/misc.lua | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rules/regexp/misc.lua b/rules/regexp/misc.lua
index d5dac650e..2076c78fa 100644
--- a/rules/regexp/misc.lua
+++ b/rules/regexp/misc.lua
@@ -130,10 +130,10 @@ local id = rspamd_config:register_symbol{
               local acc = base58_dec[ch] or 0
               for i=25,1,-1 do
                 acc = acc + (58 * bytes[i]);
-                bytes[i] = math.fmod(acc, 256);
-                acc = math.modf(acc / 256);
+                bytes[i] = acc % 256
+                acc = math.floor(acc / 256);
               end
-            end, fun.tail(word)) -- Tail due to first byte is version
+            end, word)
             -- Now create a validation tag
             local sha256 = hash.create_specific('sha256')
             for i=1,21 do


More information about the Commits mailing list