-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BufferOverflowException in SocketChannelOutputBuffer #23
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented { ByteBuffer tmp = ByteBuffer.allocate( outputByteBuffer.capacity() * 2); outputByteBuffer.flip(); tmp.put(outputByteBuffer); outputByteBuffer = tmp; } outputByteBuffer.put(cbuf, off, len); |
@glassfishrobot Commented |
@glassfishrobot Commented 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); |
@glassfishrobot Commented |
@glassfishrobot Commented [ja120114@localhost trunk]$ svn commit |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
FISH-31 Support JDK9 ALPN APIs
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: