From: SmallJoker Date: Tue, 9 May 2017 21:11:20 +0000 (+0200) Subject: minetest.deserialize: Throw error when argument not string (#5738) X-Git-Tag: 0.4.16~127 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6945f807abd789e0f522351e5e790ff2afced233;p=oweals%2Fminetest.git minetest.deserialize: Throw error when argument not string (#5738) --- 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