chiark / gitweb /
config: bail on same quote in quotes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Aug 2021 01:46:58 +0000 (02:46 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Aug 2021 01:48:47 +0000 (02:48 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/config.rs

index 3a45eb81928a974d4c3071e4767bb59278a748dc..d899348ee59afc791cbf553f0ad0a14495f33907 100644 (file)
@@ -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))