The Reference Source page for stringbuilder.cs has this comment in the ToString
method:
if (chunk.m_ChunkLength > 0)
{
// Copy these into local variables so that they
// are stable even in the presence of ----s (hackers might do this)
char[] sourceArray = chunk.m_ChunkChars;
int chunkOffset = chunk.m_ChunkOffset;
int chunkLength = chunk.m_ChunkLength;
What does this mean? Is ----s
something a malicious user might insert into a string to be formatted?
In the CoreCLR repository you have a fuller quote:
Github
Basically: it's a threading consideration.