mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
minetest.deserialize: Throw error when argument not string (#5738)
This commit is contained in:
parent
34c52d0ad7
commit
6945f807ab
1 changed files with 4 additions and 0 deletions
|
@ -186,6 +186,10 @@ local safe_env = {
|
||||||
}
|
}
|
||||||
|
|
||||||
function core.deserialize(str, safe)
|
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
|
if str:byte(1) == 0x1B then
|
||||||
return nil, "Bytecode prohibited"
|
return nil, "Bytecode prohibited"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue