On Fri, Jan 30, 2009 at 11:21 PM,  <nextgens at freenetproject.org> wrote:
> Author: nextgens
> Date: 2009-01-30 15:21:49 +0000 (Fri, 30 Jan 2009)
> New Revision: 25397
>
> Modified:
>   trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
> Log:
> doh!
>
> Modified: trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
> ===================================================================
> --- trunk/freenet/src/freenet/support/io/LineReadingInputStream.java    
> 2009-01-30 15:08:15 UTC (rev 25396)
> +++ trunk/freenet/src/freenet/support/io/LineReadingInputStream.java    
> 2009-01-30 15:21:49 UTC (rev 25397)
> @@ -35,7 +35,7 @@
>                int ctr = 0;
>                mark(maxLength + 2); // in case we have both a \r and a \n
>                while(true) {
> -                       int x = read(buf, ctr, buf.length - ctr);
> +                       int x = read(buf, ctr, Math.min(1, buf.length - ctr));

why?
this would throw ArrayOutOfBoundException if buf.length<=ctr,  no?

>                        if(x == -1) {
>                                if(ctr == 0)
>                                        return null;
>
> _______________________________________________
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
>

Reply via email to