Skip to content

Bound handleize stack allocation - #997

Merged
sebastienros merged 3 commits into
mainfrom
copilot/fix-handleize-stack-overflow
Sep 3, 2026
Merged

Bound handleize stack allocation#997
sebastienros merged 3 commits into
mainfrom
copilot/fix-handleize-stack-overflow

Conversation

Copilot AI commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

handleize sized its stack buffer from user-controlled input length, allowing large values to terminate the process with an uncatchable stack overflow.

  • Allocation safety

    • Use a fixed 512-character stack buffer.
    • Let ValueStringBuilder expand into pooled heap storage for larger output.
  • Regression coverage

    • Add coverage for a 377,000-character input.
var result = new ValueStringBuilder(stackalloc char[512]);

Co-authored-by: sebastienros <1165805+sebastienros@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix uncatchable stack overflow in Fluid's handleize filter Bound handleize stack allocation Sep 3, 2026
Copilot AI requested a review from sebastienros September 3, 2026 15:38
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@sebastienros
sebastienros marked this pull request as ready for review September 3, 2026 15:50
@sebastienros
sebastienros merged commit c9d9008 into main Sep 3, 2026
3 checks passed
@sebastienros
sebastienros deleted the copilot/fix-handleize-stack-overflow branch September 3, 2026 15:50
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.

Uncatchable stack overflow in Fluid's handleize filter from an unbounded stackalloc

2 participants