Browsing through the CXF code, I stumbled over the following in AttachmentDeserializerTest, method testCXF3383():
I think some "count += sz" has been forgotten. Details:
- The while-loop does nothing to change the test result.
- Endless loop, should "ins" ever deliver 1025 bytes or more.
- (If "ins" is 0 bytes, then count will be -1.)
- The fix is obvious, I'll attach a patch.
The problem does not show as long as "ins" contains less than 1024 bytes and all its content is delivered with the first read operation. So no functional impairment, just code hygiene.