From c0e15f80395c488709b9e1bac6bec664791a5448 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 7 May 2021 12:08:18 +0100 Subject: [PATCH] [Minor] Try to fix another boundary issue --- 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 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 -- 2.47.3