Explorar o código

Merge pull request #186 from agayardo/develop

Fix for recently introduced regression in SftpFileStream.Read(...).
Gert Driesen %!s(int64=8) %!d(string=hai) anos
pai
achega
04ca23176a

+ 2 - 0
src/Renci.SshNet/Abstractions/ThreadAbstraction.cs

@@ -36,6 +36,8 @@ namespace Renci.SshNet.Abstractions
         /// <param name="action">The action to execute.</param>
         public static void ExecuteThread(Action action)
         {
+            if (action == null)
+                throw new ArgumentNullException("action");
 #if FEATURE_THREAD_THREADPOOL
             System.Threading.ThreadPool.QueueUserWorkItem(o => action());
 #elif FEATURE_THREAD_TAP

+ 1 - 1
src/Renci.SshNet/Sftp/SftpFileStream.cs

@@ -372,7 +372,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