[
https://issues.apache.org/jira/browse/PROTON-2982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18124165#comment-18124165
]
ASF subversion and git services commented on PROTON-2982:
---------------------------------------------------------
Commit c739c30d2b598970ff0729991b37e3d29667cc42 in qpid-protonj2's branch
refs/heads/1.x from Thomas Hayen
[ https://gitbox.apache.org/repos/asf?p=qpid-protonj2.git;h=c739c30d ]
PROTON-2982 fix index computation in ProtonCompositeBufferImpl
> [protonj2] 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
> Priority: Major
> Fix For: protonj2-1.4.0
>
>
> Decoding a message whose Properties/Symbol fields are read from a composite
> buffer assembled across multiple incoming transfer frames can fail with:
> {noformat}
> 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)
> {noformat}
>
> 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]