forked from Dependencies/lua-json
Fixed parse_object() to disallow non-string keys
parent
e150a5239c
commit
8d14272359
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)
|
||||||
|
|
Loading…
Reference in New Issue