diff --git a/Network/RsaStream.cs b/Network/RsaStream.cs index c30aefc..f0a4984 100644 --- a/Network/RsaStream.cs +++ b/Network/RsaStream.cs @@ -147,7 +147,7 @@ public override int Read(byte[] buffer, int offset, int count) { int actualSize = Math.Min(this.pendingBytes.Length, count); (byte[] temp, this.pendingBytes) = (this.pendingBytes[0..actualSize], this.pendingBytes[actualSize..]); - Array.Copy(temp, 0, buffer, offset, count); + Array.Copy(temp, 0, buffer, offset, actualSize); return actualSize; }