1
0
Fork 0

Fixed parse_object() to disallow non-string keys

master
rxi 2015-08-13 18:31:21 +01:00
parent e150a5239c
commit 8d14272359
1 changed files with 3 additions and 0 deletions

View File

@ -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)