changeset 7382:ff83bd43e36a

8015421: NegativeArraySizeException occurs in ChunkedOutputStream() with Integer.MAX_VALUE Summary: Ensure integer overflow does not occur Reviewed-by: chegar
author khazra
date Thu, 13 Jun 2013 11:23:00 -0700
parents f3609297a868
children 42f9ad39bf42
files src/share/classes/sun/net/www/http/ChunkedOutputStream.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/net/www/http/ChunkedOutputStream.java	Thu Jun 13 15:15:03 2013 +0400
+++ b/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();
     }