Skip to content

Integer overflow when parsing long URL #870

@Byron

Description

@Byron

When parsing the attached URL (long.url.zip) with url::Url::parse() when compiled with overflow checks, there will be an overflow in idna with the panic.

thread '<unnamed>' panicked at /rust/registry/src/index.crates.io-6f17d22bba15001f/idna-0.4.0/src/punycode.rs:272:17:
attempt to add with overflow

Without overflow checks, the same will cause an IdnaError to be created, but won't panic.

Since the URL is very long, I suppose that this issue can be prevented by avoiding to parse unrealistically long host and domain names, which makes this issue related to #868 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions