Mercurial > hg > openjdk > jdk6 > hotspot
changeset 4052:c4a6a982e426
8034926: Attribute classes properly
Summary: Add check to prevent underflow
Reviewed-by: coleenp, ahgross
author | hseigel |
---|---|
date | Mon, 07 Apr 2014 18:16:11 +0100 |
parents | b15097e6476f |
children | 3372bc2d29f0 |
files | src/share/vm/classfile/classFileParser.cpp |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/vm/classfile/classFileParser.cpp Fri Jan 10 15:38:30 2014 +0100 +++ b/src/share/vm/classfile/classFileParser.cpp Mon Apr 07 18:16:11 2014 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, 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 @@ -2416,6 +2416,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}}