Skip to content

Commit 14d39e6

Browse files
authored
Fix JSON parser stack overflow bug for some complex cases. (#241)
close #240 Signed-off-by: yihong0618 <zouzou0208@gmail.com>
1 parent 3c7eae0 commit 14d39e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autocorrect/grammar/json.pest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ colon = @{ ":" }
3939

4040
/// Misc
4141
comma = @{ "," }
42-
inner = @{ (!("\"" | "\\") ~ ANY)* ~ (escape ~ inner)? }
42+
inner = @{ ((!("\"" | "\\") ~ ANY) | escape)* }
4343
escape = @{ "\\" ~ ("\"" | "\\" | "/" | "b" | "f" | "n" | "r" | "t" | unicode) }
4444
unicode = @{ "u" ~ ASCII_HEX_DIGIT{4} }

0 commit comments

Comments
 (0)