# HG changeset patch # User hseigel # Date 1401471163 14400 # Node ID 3b0fe4ec6ebe05dea5ccc84c86883d21fe4939b5 # Parent 1fa005fb28f5cef65c592cf9cfeed3f4ed4e8524 8041717: Issue with class file parser Summary: Add better checking for bad values. Reviewed-by: coleenp, lfoltan, mschoene diff -r 1fa005fb28f5 -r 3b0fe4ec6ebe src/share/vm/classfile/classFileParser.cpp --- a/src/share/vm/classfile/classFileParser.cpp Wed May 28 08:09:26 2014 -0400 +++ b/src/share/vm/classfile/classFileParser.cpp Fri May 30 13:32:43 2014 -0400 @@ -2826,6 +2826,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); @@ -2843,7 +2848,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,