cshannon opened a new pull request, #2261:
URL: https://github.com/apache/activemq/pull/2261

   This fixes the AmqpMessageSupport utility to correctly decompress the body 
of Object Message's in all cases.
   
   Previously the decompression could stop early and not decompress the entire 
stream of data. This was due to the loop incorrectly casting the read int from 
the inflater stream as a byte before comparing to -1 to look for end of stream.
   
   This is incorrect because the read() method can return a value between -1 
and 255. Java uses Two's Complement to represent signed ints, so if the 
returned value int is 255 and is cast to a byte it becomes -1. This meant that 
reading 255 would return -1 leading to the code to exit thinking end of stream 
has been reached.
   
   (cherry picked from commit 2d60a8518d635205879fb8dc391bfb312755cb6a)


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to