mirror of
https://github.com/TangentFoxy/rxi-json.lua.git
synced 2025-07-28 02:52:17 +00:00
Fixed parse_object() to disallow non-string keys
This commit is contained in:
3
json.lua
3
json.lua
@@ -298,6 +298,9 @@ local function parse_object(str, i, chr)
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
-- Read key
|
-- Read key
|
||||||
|
if str:sub(i, i) ~= '"' then
|
||||||
|
decode_error(str, i, "expected string for key")
|
||||||
|
end
|
||||||
key, i = parse(str, i)
|
key, i = parse(str, i)
|
||||||
-- Read ':' delimiter
|
-- Read ':' delimiter
|
||||||
i = next_char(str, i, space_chars, true)
|
i = next_char(str, i, space_chars, true)
|
||||||
|
Reference in New Issue
Block a user