فهرست منبع

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

Artem Gayardo-Matrosov 8 سال پیش
والد
کامیت
68dded5386
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  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