Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4391898

SocketPermission(":",...) throws ArrayIndexOutOfBoundsException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • core-libs
    • None
    • beta
    • generic
    • generic

      Recent changes to SocketPermission cause the constructor to throw
      ArrayIndexOutOfBoundsException if the host parameter is specified as ":".

      Here's a test case:

      public class Foo {
          public static void main(String[] args) {
              new java.net.SocketPermission(":", "connect");
          }
      }

      Running this test case in the latest build produces:

      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
      at java.net.Inet6Address.textToNumericFormat(Inet6Address.java:380)
      at java.net.SocketPermission.init(SocketPermission.java:336)
      at java.net.SocketPermission.<init>(SocketPermission.java:204)
      at Foo.main(Foo.java:3)

      Running it in the previous build produces no exception.

            ywangsunw Yingxian Wang (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: