Skip to content

Commit 04ca231

Browse files
authored
Merge pull request #186 from agayardo/develop
Fix for recently introduced regression in SftpFileStream.Read(...).
2 parents d3635d1 + c2bd7b5 commit 04ca231

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Renci.SshNet/Abstractions/ThreadAbstraction.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public static void ExecuteThreadLongRunning(Action action)
3636
/// <param name="action">The action to execute.</param>
3737
public static void ExecuteThread(Action action)
3838
{
39+
if (action == null)
40+
throw new ArgumentNullException("action");
3941
#if FEATURE_THREAD_THREADPOOL
4042
System.Threading.ThreadPool.QueueUserWorkItem(o => action());
4143
#elif FEATURE_THREAD_TAP

src/Renci.SshNet/Sftp/SftpFileStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ public override int Read(byte[] buffer, int offset, int count)
372372
{
373373
// copy remaining bytes to read buffer
374374
_bufferLen = data.Length - bytesToWriteToCallerBuffer;
375-
Buffer.BlockCopy(data, count, _readBuffer, 0, _bufferLen);
375+
Buffer.BlockCopy(data, bytesToWriteToCallerBuffer, _readBuffer, 0, _bufferLen);
376376
}
377377
}
378378
else

0 commit comments

Comments
 (0)