Code Review Request: 7051862: CookiePolicy spec conflicts with CookiePolicy.ACCEPT_ORIGINAL_SERVER

Kurchi Hazra kurchi.subhra.hazra at oracle.com
Wed Jun 12 10:48:19 PDT 2013




Hi,

In HttpUrlConnection, if the chunk length is set to Integer.MAX_VALUE, 
our code was trying to initialize a buffer of size
greater than that, which was resulting in an integer overflow, and 
consequently a NegativeArraySizeException. This fix
ensures that while initializing the internal buffer, we never exceed the 
maximum size of the chunk length fixed by the user,
and hence avert the NegativeArraySizeException.

   I have added a test to cover the case. The test will however try to 
create a buffer of size Integer.MAX_VALUE. I could
change the value of the JVM heap, but the required size (~2 GB) will be 
too large for most machines to support.
However, I am open to advice as to what I should do in this case.

Bug: http://bugs.sun.com/view_bug.do?bug_id=8015421
Webrev: http://cr.openjdk.java.net/~khazra/8015421/webrev.00/



Thanks,
Kurchi



More information about the net-dev mailing list