8034926: Attribute classes properly
Summary: Add check to prevent underflow
Reviewed-by: coleenp, ahgross
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp Wed Jul 05 19:36:17 2017 +0200
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp Thu Feb 20 13:11:23 2014 -0500
@@ -2777,6 +2777,11 @@
"Short length on BootstrapMethods in class file %s",
CHECK);
+ guarantee_property(attribute_byte_length > sizeof(u2),
+ "Invalid BootstrapMethods attribute length %u in class file %s",
+ attribute_byte_length,
+ CHECK);
+
// The attribute contains a counted array of counted tuples of shorts,
// represending bootstrap specifiers:
// length*{bootstrap_method_index, argument_count*{argument_index}}