From 8d7517b6c9cb14cc42b9c15a9ce34ad5e19b12d3 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Thu, 5 Dec 2024 16:28:47 -0800 Subject: [PATCH] disallow newlines etc in additional property names --- parser/src/json/compiler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser/src/json/compiler.rs b/parser/src/json/compiler.rs index fdb4763c..17b230c9 100644 --- a/parser/src/json/compiler.rs +++ b/parser/src/json/compiler.rs @@ -450,7 +450,7 @@ impl Compiler { let valid = self .builder .regex - .regex(r#""([^"\\]|\\["\\/bfnrt]|\\u[0-9a-fA-F]{4})*""#.to_string()); + .regex(format!("\"({})*\"", CHAR_REGEX)); let valid_and_not_taken = self.builder.regex.and(vec![valid, not_taken]); let rx = RegexSpec::RegexId(valid_and_not_taken); self.builder.lexeme(rx, false)