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

Url::as_str() cannot be parsed back into Url #661

Closed
e00E opened this issue Dec 10, 2020 · 2 comments
Closed

Url::as_str() cannot be parsed back into Url #661

e00E opened this issue Dec 10, 2020 · 2 comments

Comments

@e00E
Copy link
Contributor

e00E commented Dec 10, 2020

While fuzzing with #660 I discovered this failing input

#[test]
fn fuzzer_error() {
    let parsed = Url::parse("h:/./\r/:").unwrap();
    dbg!(&parsed);
    /*
    Url {
        scheme: "h",
        host: None,
        port: None,
        path: "//:",
        query: None,
        fragment: None,
        username: "",
        password: None,
    }
    */
    let as_str = parsed.as_str();
    dbg!(as_str);
    // "h://:"

    // Err(ParseError::EmptyHost)
    let parsed_again = Url::parse(as_str).unwrap();
    assert_eq!(parsed, parsed_again);
}
@e00E e00E changed the title Failing fuzzer input Url::as_str() cannot be parsed back into Url Dec 10, 2020
@qsantos
Copy link
Contributor

qsantos commented Mar 8, 2023

It looks like this was resolved by #817.

@valenting
Copy link
Collaborator

Thanks, @qsantos !

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

3 participants