mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8044738: Check attribute_length of EnclosingMethod attribute
Add check that attribute_length == 4. Reviewed-by: fparain, coleenp, lfoltan
This commit is contained in:
parent
1510b7c75e
commit
70c76ec8c4
4 changed files with 166 additions and 1 deletions
|
@ -2984,9 +2984,12 @@ void ClassFileParser::parse_classfile_attributes(ClassFileParser::ClassAnnotatio
|
|||
} else if (tag == vmSymbols::tag_enclosing_method()) {
|
||||
if (parsed_enclosingmethod_attribute) {
|
||||
classfile_parse_error("Multiple EnclosingMethod attributes in class file %s", CHECK);
|
||||
} else {
|
||||
} else {
|
||||
parsed_enclosingmethod_attribute = true;
|
||||
}
|
||||
guarantee_property(attribute_length == 4,
|
||||
"Wrong EnclosingMethod attribute length %u in class file %s",
|
||||
attribute_length, CHECK);
|
||||
cfs->guarantee_more(4, CHECK); // class_index, method_index
|
||||
enclosing_method_class_index = cfs->get_u2_fast();
|
||||
enclosing_method_method_index = cfs->get_u2_fast();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue