Browse Source

Fix for data corruption when reading to a buffer that is smaller than the
internal buffer.

Artem Gayardo-Matrosov 8 năm trước cách đây
mục cha
commit
68dded5386
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/Renci.SshNet/Sftp/SftpFileStream.cs

+ 1 - 1
src/Renci.SshNet/Sftp/SftpFileStream.cs

@@ -362,7 +362,7 @@ namespace Renci.SshNet.Sftp
                         {
                             // copy remaining bytes to read buffer
                             _bufferLen = data.Length - bytesToWriteToCallerBuffer;
-                            Buffer.BlockCopy(data, count, _readBuffer, 0, _bufferLen);
+                            Buffer.BlockCopy(data, bytesToWriteToCallerBuffer, _readBuffer, 0, _bufferLen);
                         }
                     }
                     else