Kaynağa Gözat

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

Artem Gayardo-Matrosov 8 yıl önce
ebeveyn
işleme
68dded5386
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  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