Bug 50646 - Tribes ByteMessage will get corrupted if message size exceeds the underlying buffer size
Summary: Tribes ByteMessage will get corrupted if message size exceeds the underlying ...
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Cluster (show other bugs)
Version: 6.0.32
Hardware: PC All
: P2 major (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
Keywords: PatchAvailable
Depends on:
Reported: 2011-01-25 07:08 UTC by Olivier Costet
Modified: 2011-07-02 12:18 UTC (History)
1 user (show)

svn diff (509 bytes, patch)
2011-01-25 07:09 UTC, Olivier Costet
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Costet 2011-01-25 07:08:10 UTC
The Tribes ByteMessage class is used to transfer byte payloads in the context of the tribes communication framework.

Due to how the message is deserialized, there will be data loss (and hence corruption) if the message size exceeds the underlying buffer size.

The solution is to replace an ObjectInput#read(byte[]) call by ObjectInput#readFully(byte[]).

Fix is attached.
Comment 1 Olivier Costet 2011-01-25 07:09:27 UTC
Created attachment 26544 [details]
svn diff
Comment 2 Mark Thomas 2011-01-26 13:28:56 UTC
Thanks for the patch. It has been applied to 7.0.x and will be included in 7.0.7 onwards.
Comment 3 Ronald Klop 2011-06-29 10:53:45 UTC
Oliver, Mark,
Is it possible that this is an issue on Tomcat 6 also?

This is suggested in this mail:
Comment 4 Mark Thomas 2011-06-29 10:56:07 UTC
Quite possibly.
Comment 5 Mark Thomas 2011-06-29 13:33:42 UTC
Patch proposed for 6.0.x
Comment 6 Mark Thomas 2011-07-02 12:18:38 UTC
Fixed in 6.0.x and will be included in 6.0.33 onwards.