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

ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 23
    • 22
    • core-libs

      The specifiaction for ClassModel parse(byte[] bytes) states
      Throws: IllegalArgumentException - if the classfile format is unsupported or invalid.

      Some invalid class files violate this assertion, leading to unexpected exceptions:
            "BrokenCode.class" // java.lang.classfile.constantpool.ConstantPoolException: Bad CP UTF8 index: 1536
            "BadConstantPoolCount.class" // java.lang.ArrayIndexOutOfBoundsException: Index 49915 out of bounds for length 174
            "BadCPTag.class" // java.lang.classfile.constantpool.ConstantPoolException: Bad tag (254) at index (12) position (161)

            asotona Adam Sotona
            lkuskov Leonid Kuskov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: