-
Bug
-
Resolution: Fixed
-
P4
-
22.0.1
-
None
Out-of-spec classfiles can trigger an AIOOBE in the ClassFileAPi, as demonstrated with the javap tool:
javap -v AIOOBE.class
..
java.lang.ArrayIndexOutOfBoundsException: Index 41 out of bounds for length 13
at java.base/jdk.internal.classfile.impl.CodeImpl.inflateLineNumbers(CodeImpl.java:241)
at java.base/jdk.internal.classfile.impl.CodeImpl.inflateMetadata(CodeImpl.java:125)
at java.base/jdk.internal.classfile.impl.CodeImpl.forEachElement(CodeImpl.java:170)
at java.base/java.lang.classfile.CompoundElement.elementList(CompoundElement.java:94)
at java.base/java.lang.classfile.CompoundElement.elements(CompoundElement.java:65)
at java.base/java.lang.classfile.CompoundElement.iterator(CompoundElement.java:74)
at jdk.jdeps/com.sun.tools.javap.CodeWriter.writeInstrs(CodeWriter.java:97)
at jdk.jdeps/com.sun.tools.javap.CodeWriter.write(CodeWriter.java:76)
javap -v AIOOBE.class
..
java.lang.ArrayIndexOutOfBoundsException: Index 41 out of bounds for length 13
at java.base/jdk.internal.classfile.impl.CodeImpl.inflateLineNumbers(CodeImpl.java:241)
at java.base/jdk.internal.classfile.impl.CodeImpl.inflateMetadata(CodeImpl.java:125)
at java.base/jdk.internal.classfile.impl.CodeImpl.forEachElement(CodeImpl.java:170)
at java.base/java.lang.classfile.CompoundElement.elementList(CompoundElement.java:94)
at java.base/java.lang.classfile.CompoundElement.elements(CompoundElement.java:65)
at java.base/java.lang.classfile.CompoundElement.iterator(CompoundElement.java:74)
at jdk.jdeps/com.sun.tools.javap.CodeWriter.writeInstrs(CodeWriter.java:97)
at jdk.jdeps/com.sun.tools.javap.CodeWriter.write(CodeWriter.java:76)