8034926: Attribute classes properly
authorhseigel
Thu, 20 Feb 2014 13:11:23 -0500
changeset 23840 a1963807bff5
parent 23816 b47e02119575
child 23841 f861d5d148bf
8034926: Attribute classes properly Summary: Add check to prevent underflow Reviewed-by: coleenp, ahgross
hotspot/src/share/vm/classfile/classFileParser.cpp
--- 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}}