diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2017-05-09 23:11:20 +0200 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-05-09 23:11:20 +0200 |
commit | 6945f807abd789e0f522351e5e790ff2afced233 (patch) | |
tree | 13a4393c035632f288f451ebe99feb24351ec6b8 /builtin | |
parent | 34c52d0ad76f627c719adc8806ca71c4968b8b39 (diff) | |
download | minetest-6945f807abd789e0f522351e5e790ff2afced233.tar.gz minetest-6945f807abd789e0f522351e5e790ff2afced233.tar.bz2 minetest-6945f807abd789e0f522351e5e790ff2afced233.zip |
minetest.deserialize: Throw error when argument not string (#5738)
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/common/serialize.lua | 4 |
1 files changed, 4 insertions, 0 deletions
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 |