[freenet-cvs] r18359 - trunk/freenet/src/freenet/io/xfer

toad at freenetproject.org toad at freenetproject.org
Tue Mar 4 17:47:03 UTC 2008


Author: toad
Date: 2008-03-04 17:47:03 +0000 (Tue, 04 Mar 2008)
New Revision: 18359

Modified:
   trunk/freenet/src/freenet/io/xfer/PartiallyReceivedBulk.java
Log:
Discard blocks with too high blockNo

Modified: trunk/freenet/src/freenet/io/xfer/PartiallyReceivedBulk.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/PartiallyReceivedBulk.java	2008-03-04 17:37:43 UTC (rev 18358)
+++ trunk/freenet/src/freenet/io/xfer/PartiallyReceivedBulk.java	2008-03-04 17:47:03 UTC (rev 18359)
@@ -94,6 +94,10 @@
 	 * @param offset The start of the data in the buffer.
 	 */
 	void received(int blockNum, byte[] data, int offset, int length) {
+		if(blockNum > blocks) {
+			Logger.error(this, "Received block "+blockNum+" of "+blocks+" !");
+			return;
+		}
 		if(Logger.shouldLog(Logger.MINOR, this))
 			Logger.minor(this, "Received block "+blockNum);
 		BulkTransmitter[] notifyBTs;




More information about the cvs mailing list