Hayen Thomas created PROTON-2982:
------------------------------------
Summary: ProtonCompositeBufferImpl.copy() throws
IndexOutOfBoundsException when the copied range starts in a non-first chunk
Key: PROTON-2982
URL: https://issues.apache.org/jira/browse/PROTON-2982
Project: Qpid Proton
Issue Type: Bug
Components: protonj2
Affects Versions: protonj2-1.3.0
Reporter: Hayen Thomas
Assignee: Timothy A. Bish
Decoding a message whose Properties/Symbol fields are read from a composite
buffer assembled across multiple incoming transfer frames can fail with:
Caused by: java.lang.IndexOutOfBoundsException: index: -77, length: 0
(expected: range(0, 1448))
at io.netty.buffer.AbstractByteBuf.checkRangeBounds(AbstractByteBuf.java:1390)
at io.netty.buffer.AbstractByteBuf.checkIndex0(AbstractByteBuf.java:1397)
at
io.netty.buffer.PooledSlicedByteBuf.retainedSlice(PooledSlicedByteBuf.java:112)
at
org.apache.qpid.protonj2.buffer.netty.Netty4ToProtonBufferAdapter.copy(Netty4ToProtonBufferAdapter.java:438)
at
org.apache.qpid.protonj2.buffer.impl.ProtonCompositeBufferImpl.copy(ProtonCompositeBufferImpl.java:642)
at
org.apache.qpid.protonj2.buffer.impl.ProtonCompositeBufferImpl.copy(ProtonCompositeBufferImpl.java:47)
at
org.apache.qpid.protonj2.codec.decoders.primitives.AbstractSymbolTypeDecoder.readValue(AbstractSymbolTypeDecoder.java:49)
at
org.apache.qpid.protonj2.codec.decoders.primitives.AbstractSymbolTypeDecoder.readString(AbstractSymbolTypeDecoder.java:72)
at
org.apache.qpid.protonj2.codec.decoders.ProtonDecoder.readSymbol(ProtonDecoder.java:828)
at
org.apache.qpid.protonj2.codec.decoders.messaging.PropertiesTypeDecoder.readProperties(PropertiesTypeDecoder.java:123)
at
org.apache.qpid.protonj2.codec.decoders.messaging.PropertiesTypeDecoder.readValue(PropertiesTypeDecoder.java:62)
at
org.apache.qpid.protonj2.codec.decoders.messaging.PropertiesTypeDecoder.readValue(PropertiesTypeDecoder.java:38)
at
org.apache.qpid.protonj2.codec.decoders.ProtonDecoder.readObject(ProtonDecoder.java:192)
at
org.apache.qpid.protonj2.client.impl.ClientMessageSupport.decodeMessage(ClientMessageSupport.java:168)
Steps to reproduce:
1. Build a ProtonCompositeBuffer out of at least two appended buffers where
the first one is large enough that the second one does not start at
absolute index 0 (e.g. 20 + 10 + 10 bytes).
2. Call copy(index, length, readOnly) with index/length fully contained in
the second (or later) chunk.
3. Observe IndexOutOfBoundsException instead of the expected copied buffer.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]