diff src/share/vm/classfile/classFileParser.cpp @ 18104:eaf39a954227

Merge with jdk8u25-b17
author Gilles Duboscq <duboscq@ssw.jku.at>
date Thu, 16 Oct 2014 11:57:39 +0200
parents 52b4284cb496 ccfff14361ea
children b6d8deed3fd5
line wrap: on
line diff
--- a/src/share/vm/classfile/classFileParser.cpp	Thu Oct 16 11:16:01 2014 +0200
+++ b/src/share/vm/classfile/classFileParser.cpp	Thu Oct 16 11:57:39 2014 +0200
@@ -2786,11 +2786,6 @@
   ClassFileStream* cfs = stream();
   u1* current_start = cfs->current();
 
-  guarantee_property(attribute_byte_length > sizeof(u2),
-                     "Invalid BootstrapMethods attribute length %u in class file %s",
-                     attribute_byte_length,
-                     CHECK);
-
   cfs->guarantee_more(attribute_byte_length, CHECK);
 
   int attribute_array_length = cfs->get_u2_fast();
@@ -2837,6 +2832,11 @@
       "bootstrap_method_index %u has bad constant type in class file %s",
       bootstrap_method_index,
       CHECK);
+
+    guarantee_property((operand_fill_index + 1 + argument_count) < operands->length(),
+      "Invalid BootstrapMethods num_bootstrap_methods or num_bootstrap_arguments value in class file %s",
+      CHECK);
+
     operands->at_put(operand_fill_index++, bootstrap_method_index);
     operands->at_put(operand_fill_index++, argument_count);
 
@@ -2854,7 +2854,6 @@
   }
 
   assert(operand_fill_index == operands->length(), "exact fill");
-  assert(ConstantPool::operand_array_length(operands) == attribute_array_length, "correct decode");
 
   u1* current_end = cfs->current();
   guarantee_property(current_end == current_start + attribute_byte_length,