propagate from branch 'i2p.i2p.zzz.test' (head 4e891e40ee2919859df7b3ae04ecec6af4f47a35)

to branch 'i2p.i2p' (head 15f093fdaa28a510bd45965dc849c8d04e0d42f7)
This commit is contained in:
zzz
2009-03-16 19:33:14 +00:00
7 changed files with 151 additions and 10 deletions

View File

@ -74,6 +74,12 @@ public class FragmentHandler {
int padding = 0;
while (preprocessed[offset] != (byte)0x00) {
offset++; // skip the padding
// AIOOBE http://forum.i2p/viewtopic.php?t=3187
if (offset >= TrivialPreprocessor.PREPROCESSED_SIZE) {
_cache.release(new ByteArray(preprocessed));
_context.statManager().addRateData("tunnel.corruptMessage", 1, 1);
return;
}
padding++;
}
offset++; // skip the final 0x00, terminating the padding