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

Chris Hegarty chris.hegarty at oracle.com
Wed Jun 12 11:29:58 PDT 2013


The source change looks fine to me, since our implementation treats the given chunk length as the complete chunk size ( including header & footer ).

I would prefer to not add a test, if the test will end up being problematic, given this is a corner case.

-Chris

On 12 Jun 2013, at 18:48, Kurchi Hazra <kurchi.subhra.hazra at oracle.com> wrote:

> 
> 
> 
> 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