From 310a5ee8e559286ab0d0717c0f295b9fc0c5f336 Mon Sep 17 00:00:00 2001 From: Kurchi Subhra Hazra Date: Thu, 13 Jun 2013 11:23:00 -0700 Subject: [PATCH] 8015421: NegativeArraySizeException occurs in ChunkedOutputStream() with Integer.MAX_VALUE Ensure integer overflow does not occur Reviewed-by: chegar --- jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java b/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java index 96f5d8d3ae7..fc23ac683be 100644 --- a/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java +++ b/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java @@ -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(); }