fix: Fixes ValueStringBuilder infinite loop (#1311)

This commit is contained in:
Kamron Batman 2022-12-27 16:56:59 -08:00 committed by GitHub
parent e855ca1e61
commit e8396d25ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -187,6 +187,7 @@ public ref struct ValueStringBuilder
while (!((ISpanFormattable)value).TryFormat(destination, out charsWritten, format, default)) while (!((ISpanFormattable)value).TryFormat(destination, out charsWritten, format, default))
{ {
Grow(1); Grow(1);
destination = _chars[_length..];
} }
if ((uint)charsWritten > (uint)destination.Length) if ((uint)charsWritten > (uint)destination.Length)

View file

@ -176,7 +176,7 @@ namespace Server.Commands.Generic
} }
} }
public string GenerateArgString(string[] args) public static string GenerateArgString(string[] args)
{ {
if (args.Length == 0) if (args.Length == 0)
{ {