From 6945f807abd789e0f522351e5e790ff2afced233 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Tue, 9 May 2017 23:11:20 +0200 Subject: minetest.deserialize: Throw error when argument not string (#5738) --- builtin/common/serialize.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'builtin/common/serialize.lua') diff --git a/builtin/common/serialize.lua b/builtin/common/serialize.lua index b2165648e..692ddd5f0 100644 --- a/builtin/common/serialize.lua +++ b/builtin/common/serialize.lua @@ -186,6 +186,10 @@ local safe_env = { } function core.deserialize(str, safe) + if type(str) ~= "string" then + return nil, "Cannot deserialize type '"..type(str) + .."'. Argument must be a string." + end if str:byte(1) == 0x1B then return nil, "Bytecode prohibited" end -- cgit v1.2.3