commonmark / cmark

CommonMark parsing and rendering library and program in C
Other
1.6k stars 527 forks source link

Fix two cases of quadratic behavior (GHSA-66g8-4hjf-77xh) #520

Closed nwellnhof closed 5 months ago

nwellnhof commented 5 months ago

Fixes the two issues reported here: https://github.com/github/cmark-gfm/security/advisories/GHSA-66g8-4hjf-77xh

Also known as CVE-2023-24824.

jgm commented 5 months ago

This gave me a pretty significant speedup on our regular make bench - from 0.052 to 0.042 s.

nwellnhof commented 5 months ago

The speedup is probably caused by the change to S_insert_emph.

jgm commented 5 months ago

Yes - saw that!