Code Review Request: 6953455 CookieStore.add() cannot handle null URI parameter, contrary to the API specification

Neil Richards neil.richards at ngmr.net
Thu Jul 5 08:48:58 PDT 2012


Hi Chris,
Some QA folk round these parts observed the problem in 7.

I told them of the fix in 8 [1] & they expressed interest in it being
backported to 7u.

I've confirmed that the problem still exists in the jdk7u code.

I've uploaded a webrev of the fix applied back onto jdk7u-dev [2], for
review.

If approved, I could push the change to jdk7u-dev too, unless that's
considered to be stepping on Kurchi's toes or otherwise bad form.

Regards,
Neil

[1] http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/74f5fef1d961
[2] http://cr.openjdk.java.net/~ngmr/6953455.7u/webrev.00/

On Wed, 2012-07-04 at 21:34 +0100, Chris Hegarty wrote:
> Seems like a reasonable candidate for a backport. Are you encountering it in 7?
> 
> -Chris
> 
> On 4 Jul 2012, at 15:19, Neil Richards <neil.richards at ngmr.net> wrote:
> 
> > On Fri, 2011-09-30 at 10:08 -0700, Kurchi Hazra wrote:
> >> 
> >> 
> >> Hi,
> >> 
> >>    The CookieStore.add() method throws a Null Pointer Exception when
> >> null is passed as the uri parameter, although this is allowed
> >> according to the method spec. 
> >> 
> >>     The exception is thrown because uri.getHost() is called on a null
> >> uri in an effort to add it to the uriIndex, one of the hash maps
> >> constituting the CookieStore. The fix would be to simply bypass adding
> >> the cookie to the uriIndex when uri is null.
> >> 
> >> 
> >> The fix involves updates in: 
> >> src/share/classes/java/net/InMemoryCookieStore.java
> >> 
> >> Webrev : http://cr.openjdk.java.net/~chegar/6953455/webrev.00/webrev/ 
> >> 
> >> Thanks,
> >> Kurchi
> >> 
> > 
> > Hi,
> > This bug fix looks to have been well bedded into the openjdk 8 code
> > stream at this point.
> > 
> > Would this be a good item to be applied to the jdk7u code stream ?
> > 
> > Regards,
> > Neil
> > 
> > -- 
> > Unless stated above:
> > IBM email: neil_richards at uk.ibm.com
> > IBM United Kingdom Limited - Registered in England and Wales with number 741598.
> > Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
> > 


-- 
Unless stated above:
IBM email: neil_richards at uk.ibm.com
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU




More information about the net-dev mailing list