]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix check condition
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 6 May 2021 21:24:00 +0000 (22:24 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 6 May 2021 21:24:00 +0000 (22:24 +0100)
lualib/lua_magic/heuristics.lua

index 66e186906daf3411083daa298a2e79fe7c288d8a..d977596cada19068b6905b452a90ecf4dc5dfffb 100644 (file)
@@ -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