shikhar/sshj — pull request #104 by mpoindexter (2013-02-22 05:07:13+00:00)
Title: ArrayIndexOutOfBounds when writing to a SFTP RemoteFile's OutputStream with large buffer

If ChannelOutputStream.write(byte[], int, int) was called with a buffer larger
than bufferSize the loop in that method would call DataBuffer.write with a small len
and a large off. This would cause the calculation in line 90 to return a negative n
leading to a ArrayIndexOutOfBounds. The offset should not be taken into account when
calculating the number of bytes to put in the buffer.