From: Vsevolod Stakhov Date: Fri, 7 May 2021 11:08:18 +0000 (+0100) Subject: [Minor] Try to fix another boundary issue X-Git-Tag: 3.0~425 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c0e15f80395c488709b9e1bac6bec664791a5448;p=thirdparty%2Frspamd.git [Minor] Try to fix another boundary issue --- diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua index fc77438967..f539954efd 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 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