Skip to content
Permalink
Browse files

minetest.deserialize: Throw error when argument not string (#5738)

  • Loading branch information
SmallJoker authored and nerzhul committed May 9, 2017
1 parent 34c52d0 commit 6945f807abd789e0f522351e5e790ff2afced233
Showing with 4 additions and 0 deletions.
  1. +4 −0 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

0 comments on commit 6945f80

Please sign in to comment.