Closed nwellnhof closed 2 years ago
Found by OSS-Fuzz:
I haven't investigated the test case form OSS-Fuzz, but the stack trace contains the function get_containing_block in the Commonmark renderer which can obviously lead to quadratic behavior with deeply nested inlines:
get_containing_block
python3 -c 'print("*"*100000+"a"+"*"*100000)' |build/src/cmark -t commonmark |wc -c
Your fix seems excellent -- go ahead and submit a PR.
Found by OSS-Fuzz:
I haven't investigated the test case form OSS-Fuzz, but the stack trace contains the function
get_containing_block
in the Commonmark renderer which can obviously lead to quadratic behavior with deeply nested inlines: