Skip to content

test: more setext-underline variants of to_html.rs:197 panic (GH-22)#210

Open
ChristianMurphy wants to merge 1 commit intowooorm:test/link-headingfrom
ChristianMurphy:test/setext-variants-pr22
Open

test: more setext-underline variants of to_html.rs:197 panic (GH-22)#210
ChristianMurphy wants to merge 1 commit intowooorm:test/link-headingfrom
ChristianMurphy:test/setext-variants-pr22

Conversation

@ChristianMurphy
Copy link
Copy Markdown
Collaborator

Adds 3 input-shape variants of the buffer-stack-underflow panic at src/to_html.rs:197 ("at least one buffer should exist") that this PR already covers with [:]:a\n-\na\n- and a\n-\n--\na\n-. All three new shapes panic at the same site in 1.0.0 release; the panic is not sensitive to the specific characters or attention markers around the setext underlines:

  • x\n=\n=\nx\n=\n (10B) — the smallest reproducer from a fuzzing campaign; alternating paragraph + underline + underline + paragraph + underline.
  • Foo *bar*\n=========\n---------\nr*\n=========\n-------- — setext underlines mixed with *…* attention runs across multiple blocks; confirms attention parsing isn't load-bearing for the panic.
  • a\n-\n--\na\n- with Options::gfm() — same shape as case 2 of this PR but with GFM options; confirms the panic is not gated on default options and is reachable from any preset that goes through the same compile path.

Verified to fail against markdown = "=1.0.0" in release. Use the weaker matches!(_, Ok(_)) assertion since the spec-correct HTML output for these inputs is not load-bearing for what this test demonstrates, only that the call returns rather than panics.

Found via in-tree fuzzing campaign.

Related-to: GH-22.

…mGH-22)

Adds 3 input-shape variants of the buffer-stack-underflow panic at
`src/to_html.rs:197` ("at least one buffer should exist") that this PR
already covers with `[:]:a\n-\na\n-` and `a\n-\n--\na\n-`. All three
new shapes panic at the same site in 1.0.0 release; the panic is not
sensitive to the specific characters or attention markers around the
setext underlines:

* `x\n=\n=\nx\n=\n` (10B) — the smallest reproducer from a fuzzing
  campaign; alternating paragraph + underline + underline + paragraph +
  underline.
* `Foo *bar*\n=========\n---------\nr*\n=========\n--------` —
  setext underlines mixed with `*…*` attention runs across multiple
  blocks; confirms attention parsing isn't load-bearing for the panic.
* `a\n-\n--\na\n-` with `Options::gfm()` — same shape as case 2 of
  this PR but with GFM options; confirms the panic is not gated on
  default options and is reachable from any preset that goes through
  the same compile path.

Verified to fail against `markdown = "=1.0.0"` in release. Use the
weaker `matches!(_, Ok(_))` assertion since the spec-correct HTML
output for these inputs is not load-bearing for what this test
demonstrates — only that the call returns rather than panics.

Found via in-tree fuzzing campaign.

Related-to: wooormGH-22.
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

Successfully merging this pull request may close these issues.

1 participant