Skip to content

Commit

Permalink
Clear the buffer in the array pool before returning a reference
Browse files Browse the repository at this point in the history
  • Loading branch information
nxrighthere authored Jun 7, 2023
1 parent eb2ce33 commit ad56193
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/Managed/Framework/Framework.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public static byte[] GetStringBuffer() {
if (stringBuffer == null)
stringBuffer = GC.AllocateUninitializedArray<byte>(8192, pinned: true);

Array.Clear(mStringBuffer, 0, mStringBuffer.Length);

return stringBuffer;
}
}
Expand Down

0 comments on commit ad56193

Please sign in to comment.