File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -514,6 +514,10 @@ static pfunc check_literal(struct jv_parser* p) {
514
514
case 'f' : pattern = "false" ; plen = 5 ; v = jv_false (); break ;
515
515
case '\'' :
516
516
return "Invalid string literal; expected \", but got '" ;
517
+ case '/' :
518
+ case '*' :
519
+ case '&' :
520
+ return "Invalid literal" ;
517
521
case 'n' :
518
522
// if it starts with 'n', it could be a literal "nan"
519
523
if (p -> tokenpos != 3 ) {
Original file line number Diff line number Diff line change @@ -2094,3 +2094,15 @@ null
2094
2094
try fromjson catch .
2095
2095
"{'a': 123}"
2096
2096
"Invalid string literal; expected \", but got ' at line 1, column 5 (while parsing '{'a': 123}')"
2097
+
2098
+ try fromjson catch .
2099
+ "{\"a\": /}"
2100
+ "Invalid literal at line 1, column 8 (while parsing '{\"a\": /}')"
2101
+
2102
+ try fromjson catch .
2103
+ "{\"a\": *}"
2104
+ "Invalid literal at line 1, column 8 (while parsing '{\"a\": *}')"
2105
+
2106
+ try fromjson catch .
2107
+ "{\"a\": &}"
2108
+ "Invalid literal at line 1, column 8 (while parsing '{\"a\": &}')"
You can’t perform that action at this time.
0 commit comments