From: Vsevolod Stakhov Date: Thu, 6 May 2021 21:24:00 +0000 (+0100) Subject: [Minor] Fix check condition X-Git-Tag: 3.0~427 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=24054b0a095953c6577d7f89ad4686de71345fea;p=rspamd.git [Minor] Fix check condition --- 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