]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Try to fix another boundary issue
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 7 May 2021 11:08:18 +0000 (12:08 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 7 May 2021 11:08:18 +0000 (12:08 +0100)
lualib/lua_magic/heuristics.lua

index fc774389671a34564f4109c5e0c3ad95820beb61..f539954efdf3d8ee18474ef004a1c4480eb7e151 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 idx <= len do
+      while b >= 127 and idx < len do
         -- utf8 part
         if bit.band(b, 0xe0) == 0xc0 and remain > 1 and
                 bit.band(bytes[idx + 1], 0xc0) == 0x80 then