Mantis - Quercus
Viewing Issue Advanced Details
2607 major always 04-15-08 07:41 04-16-08 10:29
sgraf  
nam  
normal  
closed 3.1.6  
Latest SVN Build fixed  
none    
none 3.1.6  
0002607: StringBuilderValuer.append(Reader reader, long length) fails with IndexOutOfBoundsException
At line 1176

int sublen = Math.min(8192, (int)length);

Will cast length to int but lenght is a long and this cast may result in a negative integer which in turn will be smaller then 8192.

To correct this proble change this line to

int sublen = (int) Math.min(8192L, length);

Path file is attached.
Call StringBuilderValuer.append(Reader reader, long length) with a long value larger them Integer.MAX_VALUE

Example:

StringBuilderValuer.append(reader, Long.MAX_VALUE)
Related to issue 0002026
 StringBuilderValue.java.diff [^] (501 bytes) 04-15-08 07:41

Notes
(0002973)
sgraf   
04-15-08 07:42   
In fact Additional Information should say:

Related to issue 0002606

Would be nice to have an edit button ;-)
(0002982)
nam   
04-16-08 10:29   
php/4409