From 09af57203e021dc02f5042b8978aa3a88e5f01b5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 8 Aug 2021 02:46:58 +0100 Subject: [PATCH] config: bail on same quote in quotes Signed-off-by: Ian Jackson --- src/config.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/config.rs b/src/config.rs index 3a45eb8..d899348 100644 --- a/src/config.rs +++ b/src/config.rs @@ -286,6 +286,12 @@ impl Aggregate { || anyhow!("mismatched quotes around quoted value") )? .to_owned(); + if unq.contains(&raw[0..1]) { + throw!(anyhow!( + "quoted value contains quote (escaping not supported)" + )) + } + Ok::<_,AE>(unq) })() .with_context(|| format!("key {:?}", key)) -- 2.30.2