# HG changeset patch # User hseigel # Date 1392921059 18000 # Node ID 0964e6038231454e40c009cd0077cea46ec962b8 # Parent 1f59838e019d5d45f44d54b11654415f2a369a8a 8034926: Attribute classes properly Summary: Add check to prevent underflow Reviewed-by: coleenp, ahgross diff -r 1f59838e019d -r 0964e6038231 src/share/vm/classfile/classFileParser.cpp --- a/src/share/vm/classfile/classFileParser.cpp Tue Feb 18 14:19:24 2014 -0800 +++ b/src/share/vm/classfile/classFileParser.cpp Thu Feb 20 13:30:59 2014 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -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}}