From 8d14272359f25ded4eba8d6f6886e633e05bc02c Mon Sep 17 00:00:00 2001 From: rxi Date: Thu, 13 Aug 2015 18:31:21 +0100 Subject: [PATCH] Fixed parse_object() to disallow non-string keys --- json.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/json.lua b/json.lua index e4cee97..1a049ee 100644 --- a/json.lua +++ b/json.lua @@ -298,6 +298,9 @@ local function parse_object(str, i, chr) break end -- Read key + if str:sub(i, i) ~= '"' then + decode_error(str, i, "expected string for key") + end key, i = parse(str, i) -- Read ':' delimiter i = next_char(str, i, space_chars, true)