Author: toad
Date: 2008-12-05 14:08:51 +0000 (Fri, 05 Dec 2008)
New Revision: 24065

Modified:
   trunk/freenet/src/freenet/node/FNPPacketMangler.java
Log:
Maybe fix ArrayIndexOutOfBounds when sending forgotten packets.


Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java
===================================================================
--- trunk/freenet/src/freenet/node/FNPPacketMangler.java        2008-12-05 
14:08:30 UTC (rev 24064)
+++ trunk/freenet/src/freenet/node/FNPPacketMangler.java        2008-12-05 
14:08:51 UTC (rev 24065)
@@ -2554,12 +2554,14 @@
                                } else {
                                        if(forgotOffsets == null)
                                                forgotOffsets = new 
byte[forgotPackets.length - i];
-                                       forgotOffsets[i] = (byte) offsetSeq;
-                                       forgotCount++;
-                                       if(forgotCount == 256)
+                                       
+                                       if(forgotCount >= 256)
                                                
packets.requeueForgot(forgotPackets, forgotCount, forgotPackets.length - 
forgotCount);
+                                       else
+                                               forgotOffsets[forgotCount++] = 
(byte) offsetSeq;
                                }
                        }
+                       if(forgotCount >= 256) forgotCount = 255;
                }
 
                plaintext[ptr++] = (byte) forgotCount;

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to