commit 24054b0: [Minor] Fix check condition

Vsevolod Stakhov vsevolod at highsecure.ru
Thu May 6 21:28:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-05-06 22:24:00 +0100
URL: https://github.com/rspamd/rspamd/commit/24054b0a095953c6577d7f89ad4686de71345fea (HEAD -> master)

[Minor] Fix check condition

---
 lualib/lua_magic/heuristics.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua
index 66e186906..d977596ca 100644
--- a/lualib/lua_magic/heuristics.lua
+++ b/lualib/lua_magic/heuristics.lua
@@ -333,7 +333,7 @@ exports.text_part_heuristic = function(part, log_obj, _)
       local b = bytes[idx]
       local n8bit = 0
 
-      while b >= 127 and n8bit < remain do
+      while b >= 127 and idx < remain do
         -- utf8 part
         if bit.band(b, 0xe0) == 0xc0 and remain > 1 and
                 bit.band(bytes[idx + 1], 0xc0) == 0x80 then


More information about the Commits mailing list