Fix parsing of invalid escape sequences

pull/22/head
sfeuerstein-op 2020-03-16 08:45:47 +00:00
parent 673d41a4fb
commit cc2b583875
1 changed files with 3 additions and 0 deletions

View File

@ -232,6 +232,9 @@ local function parse_string(str, i)
decode_error(str, j, "invalid unicode escape in string")
end
if hex:find("^[dD][89aAbB]") then
if not str:sub(j + 8, j + 12):find("%x%x%x%x") then
decode_error(str, j + 6, "invalid unicode continue sequence in string")
end
s = s .. parse_unicode_escape(str:sub(j, j + 12))
j = j + 12
else