mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-06 23:30:55 +03:00
Merge pull request #104 from mpoindexter/master
ArrayIndexOutOfBounds when writing to a SFTP RemoteFile's OutputStream with large buffer
This commit is contained in:
@@ -87,7 +87,7 @@ public final class ChannelOutputStream
|
|||||||
flush(bufferSize);
|
flush(bufferSize);
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
final int n = Math.min(len - off, win.getMaxPacketSize() - bufferSize);
|
final int n = Math.min(len, win.getMaxPacketSize() - bufferSize);
|
||||||
packet.putRawBytes(data, off, n);
|
packet.putRawBytes(data, off, n);
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user