Skip to content

Unexpected panic for malformed URI with brackets #435

@algesten

Description

@algesten

Doing some fuzzing I encountered this:

    let uri = "http://[]@[";
    let uri = uri.parse::<http::Uri>().unwrap(); // is ok
    uri.host(); // panics

The panic is parsing should validate brackets and come from here: https://github.com/hyperium/http/blob/v0.2.1/src/uri/authority.rs#L486

I expect this to surface as an Err and panic on .unwrap().

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-uriArea: Uri and partsS-bugSeverity: bug. Something is wrong!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions