Skip to content

Option::unwrap panic in parser when ENABLE_HEADING_ATTRIBUTES is set #571

@ghost

Description

I have come bearing gifts. (When looking up the spelling of that, I just learned the phrase was about the trojan horse. Neat.)

But inside of the horse is a fuzzer panic.

#[test]
fn test_bad_heading_attribute() {
    let mut opts = pulldown_cmark::Options::empty();

    opts.insert(Options::ENABLE_HEADING_ATTRIBUTES);

    let data = "[[][({][}\n-";

    for _ in pulldown_cmark::Parser::new_ext(data, opts) {};
}

This took a whole 10k seconds of CPU time, or 2 hours of wall clock time to find. So we are definitely making progress!

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