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

Avoid OOM in refill fuzz test #497

Merged
merged 1 commit into from
Nov 12, 2022
Merged

Avoid OOM in refill fuzz test #497

merged 1 commit into from
Nov 12, 2022

Conversation

mgeisler
Copy link
Owner

If two things happen at the same time:

  1. the input string has a huge prefix which is taken to be the indentation (such as “- - - - -”), and
  2. the wrapping with is set to something small (such as 0),

then we can end up allocating an enormous amount of data in the output. The problem is that we add the indentation on every line of the output, and we end up with a huge number of lines when the line width is small.

This was reported in OSS-Fuzz, please see
https://oss-fuzz.com/testcase-detail/4890847154143232.

If two things happen at the same time:

1. the input string has a huge prefix which is taken to be the
   indentation (such as “- - - - -”), and
2. the wrapping with is set to something small (such as 0),

then we can end up allocating an enormous amount of data in the
output. The problem is that we add the indentation on every line of
the output, and we end up with a huge number of lines when the line
width is small.

This was reported in OSS-Fuzz, please see
https://oss-fuzz.com/testcase-detail/4890847154143232.
@mgeisler mgeisler merged commit 03c0b2a into master Nov 12, 2022
@mgeisler mgeisler deleted the fuzz-oom branch November 12, 2022 19:44
@github-actions github-actions bot mentioned this pull request Feb 11, 2024
This pull request was closed.
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.

1 participant