Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce an overall limit to link. ref. defs instantiations. #239

Merged
merged 2 commits into from
Feb 7, 2024
Merged

Conversation

mity
Copy link
Owner

@mity mity commented Feb 7, 2024

This is to prevent time and output size explosion in case of input pattern generated by this:

$ python -c 'N=1000; print("[x]: " + "x" * N + "\n[x]" * N)'

We roughly allow to blowing up the input size of the document 16 times by link reference definitions or up to 1 MB, whatever is smaller. When the threshold is reached, following reference definitions are sent to output unresolved as a text.

Fixes #238.

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6c29f60) 91.76% compared to head (b71ceef) 91.79%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #239      +/-   ##
==========================================
+ Coverage   91.76%   91.79%   +0.02%     
==========================================
  Files           5        5              
  Lines        3402     3412      +10     
==========================================
+ Hits         3122     3132      +10     
  Misses        280      280              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This is to prevent time and output size explosion in case of input
pattern generated by this:

    $ python -c 'N=1000; print("[x]: " + "x" * N + "\n[x]" * N)'

We roughly allow to blowing up the input size of the document
16 times by link reference definitions or up to 1 MB, whatever is
smaller. When the threshold is reached, following reference definitions
are sent to output unresolved as a text.

Fixes #238.
@mity mity merged commit a16575e into master Feb 7, 2024
14 checks passed
@mity mity deleted the fix_238 branch February 17, 2024 14:04
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.

pathologic input: O(n^2) with link ref. defs
1 participant