8207944: java.lang.ClassFormatError: Extra bytes at the end of class file test" possibly violation of JVMS 4.7.1

Add code to skip over unknown attributes when class file version >= 11.

Reviewed-by: lfoltan
This commit is contained in:
Harold Seigel 2018-07-26 15:56:37 -04:00
parent 5b9175eae8
commit 5a3decc9f1
3 changed files with 149 additions and 0 deletions

View file

@ -3570,6 +3570,9 @@ void ClassFileParser::parse_classfile_attributes(const ClassFileStream* const cf
"Nest-host class_info_index %u has bad constant type in class file %s",
class_info_index, CHECK);
_nest_host = class_info_index;
} else {
// Unknown attribute
cfs->skip_u1(attribute_length, CHECK);
}
} else {
// Unknown attribute