org.apache.xmlrpc.util.HttpUtil.parseAuthorization passes null charset to
String(byte[] bytes, String charsetName);
-------------------------------------------------------------------------------------------------------------------
Key: XMLRPC-104
URL: http://issues.apache.org/jira/browse/XMLRPC-104
Project: XML-RPC
Issue Type: Bug
Components: Source
Affects Versions: 3.0rc1
Reporter: Landon Fuller
java.lang.NullPointerException: charsetName
at java.lang.String.<init>(String.java:403)
at java.lang.String.<init>(String.java:433)
at org.apache.xmlrpc.util.HttpUtil.parseAuthorization(HttpUtil.java:149)
at
org.apache.xmlrpc.webserver.Connection.getRequestConfig(Connection.java:162)
at org.apache.xmlrpc.webserver.Connection.run(Connection.java:174)
at
org.apache.xmlrpc.util.ThreadPool$MyThread.runTask(ThreadPool.java:71)
at org.apache.xmlrpc.util.ThreadPool$MyThread.run(ThreadPool.java:87)
Code in question, from HttpUtil.parseAuthorization():
String auth = st.nextToken();
try {
byte[] c = Base64.decode(auth.toCharArray(), 0, auth.length());
String str = new String(c, pConfig.getBasicEncoding()); <-- Will
return null
int col = str.indexOf(':');
if (col >= 0) {
pConfig.setBasicUserName(str.substring(0, col));
pConfig.setBasicPassword(str.substring(col+1));
}
If no charset is specifed, shouldn't the code assume UTF-8 (or ISO-8859-1)?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira