Author: toad
Date: 2006-07-14 21:31:28 +0000 (Fri, 14 Jul 2006)
New Revision: 9611

Modified:
   trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
Log:
fix ArrayIndexOutOfBoundsException

Modified: trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
===================================================================
--- trunk/freenet/src/freenet/support/io/LineReadingInputStream.java    
2006-07-14 21:26:44 UTC (rev 9610)
+++ trunk/freenet/src/freenet/support/io/LineReadingInputStream.java    
2006-07-14 21:31:28 UTC (rev 9611)
@@ -20,7 +20,7 @@
         */
        public String readLine(int maxLength, int bufferSize, boolean utf) 
throws IOException {
                if(buf == null)
-                       buf = new byte[Math.max(128, Math.min(1024, 
bufferSize))];
+                       buf = new byte[Math.max(Math.min(128,maxLength), 
Math.min(1024, bufferSize))];
                int ctr = 0;
                while(true) {
                        int x = read();


Reply via email to