Skip to content

Commit

Permalink
minetest.deserialize: Throw error when argument not string (#5738)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker authored and nerzhul committed May 9, 2017
1 parent 34c52d0 commit 6945f80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions builtin/common/serialize.lua
Expand Up @@ -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
Expand Down

0 comments on commit 6945f80

Please sign in to comment.