mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-10 09:15:47 +00:00
99ef23cd87
The new(-ish) implementation of SshCommand has a race condition for short-lived commands where SSH_MSG_CHANNEL_CLOSE may be processed on the message loop thread before SSH_MSG_CHANNEL_SUCCESS is waited upon on the Execute (main) thread. This manifests in an ArgumentNull/NullReference exception on the wait handle because the channel has already been closed and disposed. Fix this by only delaying the channel dispose until the command dispose.