Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
5.0.0
-
None
-
None
-
Ubuntu 7.10 / i686
Sun Java 1.6.0_03
Description
When using JMS streaming, an ArrayOutOfBoundsException occurs in ActiveMQInputStream if the length of the streamed content is exactly a multiple of the chunk size sent by ActiveMQOutputStream (64KB at the moment).
The last message received by fillBuffer in such a case has a bodyLength of 0, so
buffer = new byte[0]; // line 225
pos = 0; // line 227
and in the next invocation of read()
return buffer[pos]; // line 180
fails with:
java.lang.ArrayIndexOutOfBoundsException: 0
at org.apache.activemq.ActiveMQInputStream.read(ActiveMQInputStream.java:180)
at Crash.main(Crash.java:54)
Attached is Crash.java which produces the exception.