-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
8, 17
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
URL(string) constructor doesn't check port > 65535.
By the way this API is already @Deprecated(since = "20").
---------- BEGIN SOURCE ----------
import java.net.*;
public class URLTest {
public static void main(String args[]) throws Exception {
try {
URL url = new URL("http://[fe80::]:999999/path1/path2");
System.out.println(url.getPort());
throw new RuntimeException("URL parser accepted invalid port number");
} catch (MalformedURLException me) {
System.out.println("Caught expected exception (invalid port): " + me.getMessage());
}
}
}
---------- END SOURCE ----------
URL(string) constructor doesn't check port > 65535.
By the way this API is already @Deprecated(since = "20").
---------- BEGIN SOURCE ----------
import java.net.*;
public class URLTest {
public static void main(String args[]) throws Exception {
try {
URL url = new URL("http://[fe80::]:999999/path1/path2");
System.out.println(url.getPort());
throw new RuntimeException("URL parser accepted invalid port number");
} catch (MalformedURLException me) {
System.out.println("Caught expected exception (invalid port): " + me.getMessage());
}
}
}
---------- END SOURCE ----------