Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A single escape character is accepted by Name::parse, and doesn't round-trip #1575

Open
saethlin opened this issue Oct 25, 2021 · 0 comments

Comments

@saethlin
Copy link
Contributor

Another finding from fuzzing.

use trust_dns_proto::rr::Name;
use trust_dns_proto::serialize::binary::{BinDecodable, BinEncodable};
fn main() {
    let name = Name::parse("\\", None).unwrap();
    println!("{:?}", name);
    let bytes = name.to_bytes().unwrap();
    println!("{:?}", bytes);
    let name = Name::from_bytes(&bytes).unwrap();
    println!("{:?}", name);
}

Outputs

"\\" None Name("")
Name("")
[0]
Name(".")

Name("") seems definitely wrong to me. Is Name::parse supposed to reject this string?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant