mity / md4c

C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
MIT License
776 stars 146 forks source link

Crash #10

Closed mity closed 5 years ago

mity commented 7 years ago

American Fuzzy Lop has found a crash with a pattern I was able to minimize into this.

[x]:
x
- <?

  x
mity commented 5 years ago

The above fixed the crash, but we generated bad output:

<ul>
<li><?
<p>x</p>
</li>
</ul>

But the x cannot be a new block. There is no line fulfilling the end-condition for the HTML block started by <?.

Therefore the right output should be

<ul>
<li><?

x
</li>
</ul>