8015421: NegativeArraySizeException occurs in ChunkedOutputStream() with Integer.MAX_VALUE

Ensure integer overflow does not occur

Reviewed-by: chegar
This commit is contained in:
Kurchi Subhra Hazra 2013-06-13 11:23:00 -07:00
parent b595458607
commit 310a5ee8e5

View File

@ -125,7 +125,7 @@ public class ChunkedOutputStream extends PrintStream {
completeHeader = getHeader(preferredChunkDataSize);
/* start with an initial buffer */
buf = new byte[preferredChunkDataSize + 32];
buf = new byte[preferredChunkGrossSize];
reset();
}