ASM 4.0: ClassVersion check in ClassReader looks at wrong offset
When I create a ClassReader and point it at a byte[] but not at the beginning, I
can get an IllegalArgumentException.
Seems that the problem is caused by this code:
public ClassReader(final byte[] b, final int off, final int len) {
this.b = b;
// checks the class version
if (readShort(6) > Opcodes.V1_7) {
throw new IllegalArgumentException();
}
It should be readShort(offs + 6) instead of readShort(6).
In addition, it looks as if Opcodes.V1_1 > Opcodes.V1_7, so this might also
reject ancient V1_1 class files (but I did not verify this).