From f76c01c3aac42a90708d3bbc665e5524b6a62778 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Sat, 24 Aug 2013 18:16:05 +0200 Subject: [PATCH] [#1782] Fix IndexOutOfBoundException with direct buffer and gathering writes --- .../src/main/java/io/netty/channel/ChannelOutboundBuffer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java b/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java index 190028df5b..8d1bbf6208 100644 --- a/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java +++ b/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java @@ -336,7 +336,7 @@ public final class ChannelOutboundBuffer { nioBuffers[nioBufferCount ++] = buf.internalNioBuffer(readerIndex, readableBytes); } else { ByteBuffer[] nioBufs = buf.nioBuffers(); - if (nioBufferCount + nioBufs.length == nioBuffers.length + 1) { + if (nioBufferCount + nioBufs.length > nioBuffers.length) { this.nioBuffers = nioBuffers = doubleNioBufferArray(nioBuffers, nioBufferCount); } for (ByteBuffer nioBuf: nioBufs) {