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

ClassFile API runs into StackOverflowError while parsing certain class' bytes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • 21
    • core-libs
    • None

      An out-of-spec class file can contain circular references which cause SOE, as seen with the "--validate" option of the jar tool.

      % jar --version
      jar 22.0.1
      % jar --validate --file=SOE.jar
      java.lang.StackOverflowError
      ..
      at java.base/jdk.internal.classfile.impl.ClassReaderImpl.readEntry(ClassReaderImpl.java:390)
      at java.base/jdk.internal.classfile.impl.ClassReaderImpl.readClassEntry(ClassReaderImpl.java:431)

        1. SOE_1.class
          0.1 kB
        2. SOE.jar
          0.5 kB
        3. Test_Java21.java
          0.3 kB
        4. Test_Java22.java
          0.3 kB

            asotona Adam Sotona
            mschoene Marc Schönefeld
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: