changeset 6242:c2071134bef6

8034926: Attribute classes properly Summary: Add check to prevent underflow Reviewed-by: coleenp, ahgross
author hseigel
date Thu, 20 Feb 2014 13:11:23 -0500
parents 4dedef5e51ed
children 9e24e2828675
files src/share/vm/classfile/classFileParser.cpp
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/classFileParser.cpp	Fri Apr 11 11:23:30 2014 -0700
+++ b/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}}