Reject names containing "s
authorMatt Corallo <git@bluematt.me>
Thu, 8 Feb 2024 20:21:11 +0000 (20:21 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 8 Feb 2024 20:21:11 +0000 (20:21 +0000)
src/rr.rs

index c80bfbbc985c5e56b15d22c510f80c74a8486892..d3a6dd466927f235fb11165e5012276637810871 100644 (file)
--- a/src/rr.rs
+++ b/src/rr.rs
@@ -33,7 +33,7 @@ impl TryFrom<String> for Name {
                if s.is_empty() { return Err(()); }
                if *s.as_bytes().last().unwrap_or(&0) != b"."[0] { return Err(()); }
                if s.len() > 255 { return Err(()); }
-               if s.chars().any(|c| !c.is_ascii_graphic() && c != '.' && c != '-') { return Err(()); }
+               if s.chars().any(|c| !c.is_ascii_graphic() || c == '"') { return Err(()); }
                for label in s.split(".") {
                        if label.len() > 63 { return Err(()); }
                }