From b238005c4b81e15c964e3a6bc2564417d57ce184 Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Fri, 7 Feb 2020 23:00:58 +0100 Subject: [PATCH] possible workaround for unpack exploit --- hacks.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hacks.lua b/hacks.lua index 9170fd3..87a30d3 100644 --- a/hacks.lua +++ b/hacks.lua @@ -7,6 +7,15 @@ minetest.find_path = function() return nil end +-- https://github.com/minetest/minetest/pull/9350 +-- Workaround for bug https://www.lua.org/bugs.html#5.2.3-1 +-- thx HybridDog ;) +local actual_unpack = unpack +function unpack(t, a, b) + assert(not b or b < 2^30) + return actual_unpack(t, a, b) +end + -- unregister ip-ban command (use xban instead) -- there are still problems with the ipv6 range comming in from a single ipv4 ip minetest.unregister_chatcommand("ban")