gemmellr opened a new pull request, #4533:
URL: https://github.com/apache/activemq-artemis/pull/4533

   The report for ARTEMIS-4340 was raised about ByteUtil.uncheckedZeros 
throwing IndexOutOfBoundsException. Though some of ByteUtil's behaviour can 
perhaps be questioned around its consistency with different buffer types, in 
this case the problem ultimately starts earlier in the call tree with 
org.apache.activemq.artemis.core.io.util.ThreadLocalByteBufferPool.borrow(int, 
boolean) passing it invalid arguments. It passes in a buffer for zeroing, with 
its limit still set below the requested size to be zero'd, leading to the 
IndexOutOfBoundsException in this case when tryign to write beyond the limit. 
The reason this seemingly long-standing bug has perhaps not been hit so far is 
that it occurs in a less typical case where the buffer isnt direct, but also 
doesnt have an array.
   
   ThreadLocalByteBufferPool should clear position+limit before zeroing the 
buffer.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to