8015421: NegativeArraySizeException occurs in ChunkedOutputStream() with Integer.MAX_VALUE
authorkhazra
Thu, 13 Jun 2013 11:23:00 -0700
changeset 18173 cf70549231af
parent 18172 f82c2fc6a875
child 18174 806bf0d6f0c7
8015421: NegativeArraySizeException occurs in ChunkedOutputStream() with Integer.MAX_VALUE Summary: Ensure integer overflow does not occur Reviewed-by: chegar
jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java
--- 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();
     }