JDK-4402326 : URLDecoder fails with certain input
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: sparc
  • Submitted: 2001-01-05
  • Updated: 2001-08-17
  • Resolved: 2001-01-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.0 betaFixed
Related Reports
Duplicate :  
Description
URLDecoder fails with certain input with merlin build 46 on Solaris. Its throwing java.lang.IllegalArgumentException with certain input. Same test passed with jdk1.3.

How to reproduce the problem:

1. Take the following code.

public class EncodeDecode {

        public static void main(String[] args) {

        String str = "aslf alsf alsdjf";
 
        if(args.length > 0)
                str=args[0];
    
 
        String encStr = URLEncoder.encode(str);
        System.out.println("Encode string " + encStr);

        String decStr = URLDecoder.decode(encStr);
        System.out.println("Decoded String " + decStr);


        }

}


2. Execute as shown below.

java EncodeDecode 'asdf @$'
	or
java EncodeDecode fdadf@$

On execution as shown above output will be like this:

% java EncodeDecode fds@$
Encode string fds%40%24
Exception in thread "main" java.lang.IllegalArgumentException: URLDecoder: Incomplete trailing escape (%) pattern
        at java.net.URLDecoder.decode(URLDecoder.java:150)
        at java.net.URLDecoder.decode(URLDecoder.java:72)
        at EncodeDecode.main(EncodeDecode.java:21)


Other Information:

1. Its passed with jdk1.3 on solaris 8.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta FIXED IN: merlin-beta INTEGRATED IN: merlin-beta VERIFIED IN: merlin-beta2
14-06-2004

EVALUATION Failure occurs when %xy are the last three bytes of string. Was not checking if string was finished.
11-06-2004