Explorar o código

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

Artem Gayardo-Matrosov %!s(int64=8) %!d(string=hai) anos
pai
achega
68dded5386
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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