-
Notifications
You must be signed in to change notification settings - Fork 60
BufferOverflowException in SocketChannelOutputBuffer #23
Comments
Reported by iasandcb@java.net |
Was assigned to grizzly-issues |
iasandcb@java.net said: |
File: ias-2007-09-17.patch |
iasandcb@java.net said: { ByteBuffer tmp = ByteBuffer.allocate( outputByteBuffer.capacity() * 2); outputByteBuffer.flip(); tmp.put(outputByteBuffer); outputByteBuffer = tmp; } outputByteBuffer.put(cbuf, off, len); |
jfarcand@java.net said: |
jfarcand@java.net said: public void realWriteBytes(byte cbuf[], int off, int len) { int size = Math.max(outputByteBuffer.capacity() * 2, len + outputByteBuffer.position()); ByteBuffer tmp = ByteBuffer.allocate(size); outputByteBuffer.flip(); tmp.put(outputByteBuffer); outputByteBuffer = tmp; } outputByteBuffer.put(cbuf, off, len); |
iasandcb@java.net said: |
jfarcand@java.net said: [ja120114@localhost trunk]$ svn commit |
jfarcand@java.net said: |
Marked as fixed on Wednesday, December 16th 2009, 6:14:16 pm |
This issue was imported from java.net JIRA GRIZZLY-23 |
public void realWriteBytes(byte cbuf[], int off, int len)
throws IOException {
if (len > 0) {
if (len > outputByteBuffer.remaining())
{ ByteBuffer tmp = ByteBuffer.allocate( outputByteBuffer.capacity() * 2 + len); outputByteBuffer.flip(); tmp.put(outputByteBuffer); outputByteBuffer = tmp; }
outputByteBuffer.put(cbuf, off, len);
}
}
if position + len is bigger than capacity * 2, outputByteBuffer overflows.
Environment
Operating System: All
Platform: All
Affected Versions
[1.9.22]
The text was updated successfully, but these errors were encountered: