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

Program Crash in fuzzing (assert failed in parse_path) #841

Open
1 task
xizheyin opened this issue Jun 12, 2023 · 0 comments
Open
1 task

Program Crash in fuzzing (assert failed in parse_path) #841

xizheyin opened this issue Jun 12, 2023 · 0 comments

Comments

@xizheyin
Copy link

  • Note that this crate implements the URL Standard not RFC 1738 or RFC 3986

Describe the bug
I have enhanced my testing tool and retested the library, only to find that the bug I previously reported has not been fully fixed. Moreover, there is a new test sequence that triggers the same assertion. Previous issue is here

version

[dependencies]
url = "2.4.0"

source code

fn main() {
    let _param0 = "\u{16}file:///11C//////\0";
    let _param2 = "..#fB????b\0\0\0?,\u{16}fil";
    let _param3 = "e\n//\u{1f}1\u{1e}01\n\n\n\n\n\n\n\n\n\n";
    let _param4 = "\n\n\n\n/:..#\u{10}o:/11;/k:";
    let _param5 = "..#,\u{16}\u{16}f\u{1f}Tl..\u{1b}, ??D@";
    /*println!(
        "_param0 = {:?}, _param2 = {:?}, _param3 = {:?}, _param4 = {:?}",
        _param0, _param2, _param3, _param4
    );*/
    let mut _local0 = if let Ok(x) = url::Url::parse(_param0) {
        x
    } else {
        use std::process;
        process::exit(0);
    };
    //let _ = url::quirks::domain_to_unicode(_param1);
    //let _ = url::Url::has_authority(&(_local0));
    let _ = url::quirks::set_pathname(&mut (_local0), _param2);
    let _ = url::quirks::username(&(_local0));
    let _ = url::quirks::pathname(&(_local0));
    let _ = url::quirks::set_hostname(&mut (_local0), _param3);
    let _ = url::quirks::host(&(_local0));
    let _ = url::quirks::set_pathname(&mut (_local0), _param4);
    let _ = url::Url::join(&(_local0), _param5);
}

error information

thread 'main' panicked at 'assertion failed: self.serialization.as_bytes()[segment_start - 1] == b\'/\'', /home/yxz/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/url-2.4.0/src/parser.rs:1236:21
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