Skip to content

panic on ampersand #78

@ms140569

Description

@ms140569

Doing this:

echo '<!DOCTYPE html><html><body></body></html>'|RUST_BACKTRACE=full htmlq '&'

(or colon ':') on tagged version 0.4.0 results in panic:

thread 'main' panicked at /home/schmidtm/.cargo/registry/src/index.crates.io-6f17d22bba15001f/htmlq-0.4.0/src/main.rs:248:10:
Failed to parse CSS selector: ()
stack backtrace:
   0:     0x55c4c7f30ec5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd736fd5964392270
   1:     0x55c4c7f5476b - core::fmt::write::hc6043626647b98ea
   2:     0x55c4c7f2ea6f - std::io::Write::write_fmt::h0d24b3e0473045db
   3:     0x55c4c7f30c9e - std::sys_common::backtrace::print::h45eb8174d25a1e76
   4:     0x55c4c7f32039 - std::panicking::default_hook::{{closure}}::haf3f0170eb4f3b53
   5:     0x55c4c7f31dda - std::panicking::default_hook::hb5d3b27aa9f6dcda
   6:     0x55c4c7f324d3 - std::panicking::rust_panic_with_hook::h6b49d59f86ee588c
   7:     0x55c4c7f323b4 - std::panicking::begin_panic_handler::{{closure}}::hd4c2f7ed79b82b70
   8:     0x55c4c7f31389 - std::sys_common::backtrace::__rust_end_short_backtrace::h2946d6d32d7ea1ad
   9:     0x55c4c7f320e7 - rust_begin_unwind
  10:     0x55c4c7e4fcd3 - core::panicking::panic_fmt::ha02418e5cd774672
  11:     0x55c4c7e50126 - core::result::unwrap_failed::h55f86ada3ace5ed2
  12:     0x55c4c7e82070 - htmlq::main::h37f3df1ab03c171f
  13:     0x55c4c7e90693 - std::sys_common::backtrace::__rust_begin_short_backtrace::ha4f687742514f178
  14:     0x55c4c7e941e9 - std::rt::lang_start::{{closure}}::hbf15eb1ebbc3f4f9
  15:     0x55c4c7f28eed - std::rt::lang_start_internal::hcee5ed89fc25829a
  16:     0x55c4c7e82ad5 - main
  17:     0x7fd32e894d90 - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  18:     0x7fd32e894e40 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:392:3
  19:     0x55c4c7e50465 - _start
  20:                0x0 - <unknown>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions