Skip to content

test: reference-link with NUL-byte definition url panics subtokenize#209

Open
ChristianMurphy wants to merge 1 commit intowooorm:mainfrom
ChristianMurphy:test/reference-link-with-nul-url
Open

test: reference-link with NUL-byte definition url panics subtokenize#209
ChristianMurphy wants to merge 1 commit intowooorm:mainfrom
ChristianMurphy:test/reference-link-with-nul-url

Conversation

@ChristianMurphy
Copy link
Copy Markdown
Collaborator

to_html_with_options("[][a \n]\n\n[a ]:\0", &Options::default()) panics in 1.0.0 release at src/subtokenize.rs:149 with expected link. The 15-byte input is a collapsed-reference link [][a \n] whose label contains a space-newline pair, paired with a definition [a ]: whose url is a single NUL byte. The link-chain consumer reaches an event whose link field is None and unconditionally expects it.

Same panic site as GH-79 ([](a (a \n))) but distinct input shape: this is a collapsed-reference link with NUL-byte url, not an inline link with a quoted title. The empty [] text and the space-newline in the label are both load-bearing. A single chain-builder integrity fix in src/construct/label_end.rs likely closes both shapes together.

Verified to fail against markdown = "=1.0.0" in release. Found via in-tree fuzzing campaign.

Related-to: GH-79.

`to_html_with_options("[][a \n]\n\n[a ]:\0", &Options::default())`
panics in 1.0.0 release at `src/subtokenize.rs:149` with `expected
link`. The 15-byte input is a collapsed-reference link `[][a \n]`
whose label contains a space-newline pair, paired with a definition
`[a ]:` whose url is a single NUL byte. The link-chain consumer
reaches an event whose `link` field is `None` and unconditionally
`expect`s it.

Same panic site as wooormGH-79 (`[](a (a \n))`) but distinct input shape:
this is a collapsed-reference link with NUL-byte url, not an inline
link with a quoted title. The empty `[]` text and the space-newline
in the label are both load-bearing. A single chain-builder integrity
fix in `src/construct/label_end.rs` likely closes both shapes
together.

Verified to fail against `markdown = "=1.0.0"` in release. Found via
in-tree fuzzing campaign.

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