FYI, please ignore the patch I posted to this group yesterday.  It is
incorrect.

The patch attached to this issue in Scarab is valid.

-David

-----Original Message-----
From: David Vandegrift [mailto:dvandegrift@;bluearc.com]
Sent: Friday, November 01, 2002 2:06 PM
To: David Vandegrift
Cc: [EMAIL PROTECTED]
Subject: [SOURCE] Issue #TTWS11 - DefaultCookieParser throws
NullPointerException


You can view the issue detail at the following URL:
<http://nagoya.apache.org/scarab/issues/id/TTWS11>

Type :        Defect
Issue Id :    TTWS11
Reported by: David Vandegrift
             [EMAIL PROTECTED] - ([EMAIL PROTECTED])

Details:

Platform: PC
Operating system: windows NT
Summary: DefaultCookieParser throws NullPointerException
Description: setRunData() in DefaultCookieParser.java will throw a
NullPointerException if the HttpRequest does not yet have any cookies
associated with it.
According to the Servlet Spec, HttpServletRequest.getCookies() retuns null
if no cookies are defined.
Cookie[] cookies = data.getRequest().getCookies();

The existing code immediately accesses cookies.length. But since cookies is
null an NPE is throw.
A patch is attached that adds a variable 'cookiesLength' and sets it's value
by checking for null first.

Also, the patch removes a the redundant line:
cookiePath = new DynamicURI(data);


*********************************************************************
This e-mail and any attachment is confidential. It may only be read, copied and used 
by the intended recipient(s). If you are not the intended recipient(s), you may not 
copy, use, distribute, forward, store or disclose this e-mail or any attachment. If 
you are not the intended recipient(s) or have otherwise received this e-mail in error, 
you should destroy it and any attachment and notify the sender by reply e-mail or send 
a message to [EMAIL PROTECTED]
*********************************************************************


--
To unsubscribe, e-mail:   <mailto:turbine-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-dev-help@;jakarta.apache.org>

Reply via email to