Skip to content

Commit 68dded5

Browse files
committed
Fix for data corruption when reading to a buffer that is smaller than the
internal buffer.
1 parent c8373c9 commit 68dded5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Renci.SshNet/Sftp/SftpFileStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ public override int Read(byte[] buffer, int offset, int count)
362362
{
363363
// copy remaining bytes to read buffer
364364
_bufferLen = data.Length - bytesToWriteToCallerBuffer;
365-
Buffer.BlockCopy(data, count, _readBuffer, 0, _bufferLen);
365+
Buffer.BlockCopy(data, bytesToWriteToCallerBuffer, _readBuffer, 0, _bufferLen);
366366
}
367367
}
368368
else

0 commit comments

Comments
 (0)