You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parsing a valid URL without a hostname causes ada-url to panic when calling Url.host(). Reproduced with v3.0.0 from crates.io.
e.g. Url::parse("file:///C:/Users/User/Documents/example.pdf", None).unwrap() then call .host() on the result:
Backtrace:
thread 'main' panicked at core/src/panicking.rs:223:5:
unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
stack backtrace:
0: rust_begin_unwind
at /rustc/a47555110cf09b3ed59811d9b02235443e76a595/library/std/src/panicking.rs:665:5
1: core::panicking::panic_nounwind_fmt::runtime
at /rustc/a47555110cf09b3ed59811d9b02235443e76a595/library/core/src/panicking.rs:119:22
2: core::panicking::panic_nounwind_fmt
at /rustc/a47555110cf09b3ed59811d9b02235443e76a595/library/core/src/intrinsics/mod.rs:3535:9
3: core::panicking::panic_nounwind
at /rustc/a47555110cf09b3ed59811d9b02235443e76a595/library/core/src/panicking.rs:223:5
4: core::slice::raw::from_raw_parts::precondition_check
at /home/mqudsi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ub_checks.rs:69:21
5: core::slice::raw::from_raw_parts
at /home/mqudsi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ub_checks.rs:76:17
6: ada_url::ffi::ada_string::as_str
at /home/mqudsi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ada-url-3.0.0/src/ffi.rs:23:25
7: ada_url::Url::host
at /home/mqudsi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ada-url-3.0.0/src/lib.rs:463:9
8: ada_rust::url_to_debug
at ./src/main.rs:51:23
9: ada_rust::<impl core::convert::Into<ada_rust::DebugUrl> for &ada_url::Url>::into
at ./src/main.rs:74:9
10: ada_rust::main
at ./src/main.rs:22:39
11: core::ops::function::FnOnce::call_once
at /home/mqudsi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
The text was updated successfully, but these errors were encountered:
Parsing a valid URL without a hostname causes
ada-url
to panic when callingUrl.host()
. Reproduced with v3.0.0 from crates.io.e.g.
Url::parse("file:///C:/Users/User/Documents/example.pdf", None).unwrap()
then call.host()
on the result:Backtrace:
The text was updated successfully, but these errors were encountered: