View | Details | Raw Unified | Return to bug 61993
Collapse All | Expand All

(-)java/org/apache/tomcat/util/buf/ByteChunk.java (-1 / +6 lines)
Lines 517-524 Link Here
517
        if( desiredSize <= buff.length ) {
517
        if( desiredSize <= buff.length ) {
518
            return;
518
            return;
519
        }
519
        }
520
        //If we are over 1Gb then doubling the buffer would overflow int 
521
        //so instead then set to the max value
522
        if(this.buff.length >= 1 * 1024 * 1024 * 1024){
523
            tmp = new byte[Integer.MAX_VALUE - 1];     
524
        }
520
        // grow in larger chunks
525
        // grow in larger chunks
521
        if( desiredSize < 2 * buff.length ) {
526
        else if( desiredSize < 2 * buff.length ) {
522
            newSize= buff.length * 2;
527
            newSize= buff.length * 2;
523
            if( limit >0 &&
528
            if( limit >0 &&
524
                newSize > limit ) {
529
                newSize > limit ) {

Return to bug 61993