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

Restrict indentation size in JsonWriterOptions theories. #101498

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7637,7 +7637,7 @@ private static IEnumerable<JsonWriterOptions> JsonOptions()
return from indented in new[] { true, false }
from skipValidation in new[] { true, false }
from indentCharacter in indented ? new char?[] { null, ' ', '\t' } : []
from indentSize in indented ? new int?[] { null, 0, 1, 2, 127 } : []
jozkee marked this conversation as resolved.
Show resolved Hide resolved
from indentSize in indented ? new int?[] { null, 0, 1, 2, 3 } : []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would the indent size result in OOMs? Significantly larger buffer sizes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. The impacted test creates very deep objects so a large indent size would contribute to substantially bigger buffer sizes.

from newLine in indented ? new string?[] { null, "\n", "\r\n" } : []
select CreateOptions(indented, indentCharacter, indentSize, skipValidation, newLine);

Expand Down
Loading