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

Prevent parsing brackets from causing panic #108

Merged
merged 1 commit into from May 11, 2015

Commits on May 11, 2015

  1. Prevent parsing brackets from causing panic

    The code:
    
    ```
    Url::parse("http://[]")
    ```
    
    The panic:
    
    ```
    thread '<main>' panicked at 'index out of bounds: the len is 0 but the index is 0',
    /Users/coreyf/.cargo/registry/src/github.com-1ecc6299db9ec823/url-0.2.34/src/host.rs:104
    ```
    
    in addition to:
    
    The code:
    
    ```
    Url::parse("http://[:]")
    ```
    
    The panic:
    
    ```
    /Users/coreyf/.cargo/registry/src/github.com-1ecc6299db9ec823/url-0.2.34/src/host.rs:104
    thread 'tests::url_parsing' panicked at 'index out of bounds: the len is
    1 but the index is 1', src/host.rs:110
    ```
    
    Was found using https://github.com/kmcallister/afl.rs 👍
    frewsxcv committed May 11, 2015
You can’t perform that action at this time.