8015421: NegativeArraySizeException occurs in ChunkedOutputStream() with Integer.MAX_VALUE
Summary: Ensure integer overflow does not occur
Reviewed-by: chegar
--- a/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java Thu Jun 13 15:15:03 2013 +0400
+++ b/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java Thu Jun 13 11:23:00 2013 -0700
@@ -125,7 +125,7 @@
completeHeader = getHeader(preferredChunkDataSize);
/* start with an initial buffer */
- buf = new byte[preferredChunkDataSize + 32];
+ buf = new byte[preferredChunkGrossSize];
reset();
}