ASF Bugzilla – Attachment 27378 Details for
Bug 51650
possible nullpointer exception in RequestUtil.parseParameters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
document that encoding must not be null and remove check
default-charset-encoding.diff (text/plain), 1.74 KB, created by
Felix Schumacher
on 2011-08-12 04:50:31 UTC
(
hide
)
Description:
document that encoding must not be null and remove check
Filename:
MIME Type:
Creator:
Felix Schumacher
Created:
2011-08-12 04:50:31 UTC
Size:
1.74 KB
patch
obsolete
>diff --git a/java/org/apache/catalina/util/RequestUtil.java b/java/org/apache/catalina/util/RequestUtil.java >index ae5615a..bf099a3 100644 >--- a/java/org/apache/catalina/util/RequestUtil.java >+++ b/java/org/apache/catalina/util/RequestUtil.java >@@ -174,8 +174,8 @@ public final class RequestUtil { > * > * @param map Map that accumulates the resulting parameters > * @param data Input string containing request parameters >- * @param encoding The encoding to use; if null, the default encoding is >- * used. If an unsupported encoding is specified the parameters will not be >+ * @param encoding The encoding to use; encoding must not be null. >+ * If an unsupported encoding is specified the parameters will not be > * parsed and the map will not be modified > */ > public static void parseParameters(Map<String,String[]> map, String data, >@@ -184,15 +184,10 @@ public final class RequestUtil { > if ((data != null) && (data.length() > 0)) { > > // use the specified encoding to extract bytes out of the >- // given string so that the encoding is not lost. If an >- // encoding is not specified, let it use platform default >+ // given string so that the encoding is not lost. > byte[] bytes = null; > try { >- if (encoding == null) { >- bytes = data.getBytes(Charset.defaultCharset()); >- } else { >- bytes = data.getBytes(B2CConverter.getCharset(encoding)); >- } >+ bytes = data.getBytes(B2CConverter.getCharset(encoding)); > parseParameters(map, bytes, encoding); > } catch (UnsupportedEncodingException uee) { > if (log.isDebugEnabled()) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 51650
:
27376
| 27378