Author: nextgens
Date: 2008-08-17 18:53:56 +0000 (Sun, 17 Aug 2008)
New Revision: 21982

Modified:
   trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
Log:
bug #2501: okay, I think that's the last one :)

Modified: trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
===================================================================
--- trunk/freenet/src/freenet/support/io/LineReadingInputStream.java    
2008-08-17 18:51:55 UTC (rev 21981)
+++ trunk/freenet/src/freenet/support/io/LineReadingInputStream.java    
2008-08-17 18:53:56 UTC (rev 21982)
@@ -57,7 +57,7 @@
                                if(ctr >= maxLength)
                                        throw new TooLongException("We reached 
maxLength="+maxLength+ " parsing\n "+HexUtil.bytesToHex(buf, 0, ctr) + "\n" + 
new String(buf, 0, ctr, utf ? "UTF-8" : "ISO-8859-1"));
                        }
-                       if(buf.length - ctr < bufferSize) {
+                       if((buf.length != maxLength) && (buf.length - ctr < 
bufferSize)) {
                                byte[] newBuf = new byte[Math.min(buf.length * 
2, maxLength)];
                                System.arraycopy(buf, 0, newBuf, 0, buf.length);
                                buf = newBuf;


Reply via email to