Skip to content

Fix CA2014: Stackalloc in loops #13531

@rjmholt

Description

@rjmholt

We currently suppress warnings of CA2014 in parts of the build. stackallocs in loops can cause stack overflows, so we need to refactor our code to fix this.

See:

Span<char> outBufferLine = stackalloc char[outBuffer.Length + endOfLineLength];

Span<char> inputBuffer = stackalloc char[CharactersToRead + 1];

Span<char> userNameStr = stackalloc char[userNameLength];
Span<char> domainNameStr = stackalloc char[domainNameLength];

Suppression added in #13530

Metadata

Metadata

Assignees

No one assigned

    Labels

    First-Time-IssueEasy issues first time contributors can work on to learn about this projectIssue-Code Cleanupthe issue is for cleaning up the code with no impact on functionalityResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions