Quadratic behavior in Commonmark renderer involving get_containing_block · Issue #431 · commonmark/cmark · GitHub
Skip to content

Quadratic behavior in Commonmark renderer involving get_containing_block #431

Closed

Description

@nwellnhof

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:

python3 -c 'print("*"*100000+"a"+"*"*100000)' |build/src/cmark -t commonmark |wc -c

Activity

  1. added a commit that references this issue on Dec 3, 2021
    bb958e6
  2. jgm commented on Dec 3, 2021

    @jgm
    Member

    Your fix seems excellent -- go ahead and submit a PR.

  3. added a commit that references this issue on Dec 3, 2021
    3d37fe2
  4. added a commit that references this issue on Dec 3, 2021
    2dca096
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions