Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 50628 invoked by uid 500); 14 Nov 2002 09:39:49 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 50607 invoked from network); 14 Nov 2002 09:39:49 -0000 Date: 14 Nov 2002 09:40:58 -0000 Message-ID: <20021114094058.8021.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: cocoon-dev@xml.apache.org Cc: Subject: DO NOT REPLY [Bug 14541] New: - NPE: in HttpRequest.decode() when setCharacterEncoding() is used. X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14541 NPE: in HttpRequest.decode() when setCharacterEncoding() is used. Summary: NPE: in HttpRequest.decode() when setCharacterEncoding() is used. Product: Cocoon 2 Version: 2.0.3 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: core AssignedTo: cocoon-dev@xml.apache.org ReportedBy: kenneth@ihavemoved.com If you changed the form-encoding in a corg.apache.cocoon.environment.http.HttpRequest, then if you call getParameter (String) or getParameterValues(String) on the same request object, looking for a parameter which is not supplied, a NullPointerException is thrown in the decode() method. To Reproduce, create a trivial pipeline such as the following: (in this example "request-parameter" refers to a org.apache.cocoon.matching.RequestParameterMatcher, and "set-encoding" is a org.apache.cocoon.acting.SetCharacterEncodingAction.) Accessing the url "/foo?EMPTY_PARAM=bar" works successfully. However, accessing the url: "/foo" This will throw a NPE, even though this pipeline should not continue to execute past the second matcher. I am pretty sure this bug can be fixed with a simple null check in the decode() method of HttpRequest (line 300), i.e. if (str == null) return null; else { str.getBytes(); ... } *WORKAROUND* This bug can be avoided by writing a custom action which calls request.setCharacterEncoding(null) before an optional parameter is attempted to be retrieved from the sitemap. --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org