Issue Details (XML | Word | Printable)

Key: XMLRPC-104
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jochen Wiedmann
Reporter: Landon Fuller
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
XML-RPC

org.apache.xmlrpc.util.HttpUtil.parseAuthorization passes null charset to String(byte[] bytes, String charsetName);

Created: 17/Aug/06 06:58 PM   Updated: 05/Oct/06 08:57 PM
Return to search
Component/s: Source
Affects Version/s: 3.0rc1
Fix Version/s: 3.0

Time Tracking:
Not Specified

Issue Links:
Duplicate
 

Resolution Date: 18/Aug/06 09:48 AM


 Description  « Hide
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)?

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jochen Wiedmann added a comment - 18/Aug/06 09:48 AM
Thanks for the hint, fixed in SVN.

Jochen Wiedmann added a comment - 05/Oct/06 08:57 PM
Release 3.0 published, closing.