Merge pull request #104 from mpoindexter/master

ArrayIndexOutOfBounds when writing to a SFTP RemoteFile's OutputStream with large buffer
This commit is contained in:
Shikhar Bhushan
2013-02-23 03:41:19 -08:00

View File

@@ -87,7 +87,7 @@ public final class ChannelOutputStream
flush(bufferSize);
return 0;
} 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);
return n;
}
@@ -214,4 +214,4 @@ public final class ChannelOutputStream
return "< ChannelOutputStream for Channel #" + chan.getID() + " >";
}
}
}