]> source.dussan.org Git - aspectj.git/commitdiff
Fix 487927: ClassFormatException if LocalVariableTable data cannot be fully read
authorAndy Clement <aclement@pivotal.io>
Thu, 18 Feb 2016 20:23:24 +0000 (12:23 -0800)
committerAndy Clement <aclement@pivotal.io>
Thu, 18 Feb 2016 20:23:24 +0000 (12:23 -0800)
bcel-builder/src/org/aspectj/apache/bcel/classfile/BootstrapMethods.java
bcel-builder/src/org/aspectj/apache/bcel/classfile/LineNumberTable.java
bcel-builder/src/org/aspectj/apache/bcel/classfile/LocalVariableTable.java
bcel-builder/src/org/aspectj/apache/bcel/classfile/MethodParameters.java
bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java
bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java
bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeTypeAnnos.java
lib/bcel/bcel-src.zip
lib/bcel/bcel.jar

index a5216f2ef2e411c746a3bea2cad56668c0f86f27..f708c0cab2504ddb6a7f7aa9a20a6ef6fbde6f30 100644 (file)
@@ -95,7 +95,7 @@ public final class BootstrapMethods extends Attribute {
        BootstrapMethods(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException {
                this(name_index, length, (BootstrapMethod[])null, constant_pool);
                data = new byte[length];
-               file.read(data);
+               file.readFully(data);
                isInPackedState = true;
        }
        
index 10d72fd3edd7e1149058b9156666cfba11df159a..871bfe6bff11f0a46c36498f4f1b58d957ce4267 100644 (file)
@@ -104,7 +104,7 @@ public final class LineNumberTable extends Attribute {
        LineNumberTable(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException {
                this(name_index, length, (LineNumber[]) null, constant_pool);
                data = new byte[length];
-               file.read(data);
+               file.readFully(data);
                isInPackedState = true;
                // assert(bytesRead==length)
        }
index 717bb596581ad3b18f581c53573e529d801d1e6a..e6415dae6ff43aee070d195f316ff8d967e90514 100644 (file)
@@ -109,7 +109,7 @@ public class LocalVariableTable extends Attribute {
        LocalVariableTable(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException {
                super(Constants.ATTR_LOCAL_VARIABLE_TABLE, name_index, length, constant_pool);
                data = new byte[length];
-               file.read(data);
+               file.readFully(data);
                isInPackedState = true;
                // assert(bytesRead==length)
        }
index 76f1642d574176db6accfa7e593ff1c01be8f4a5..5470415840c515828c6f589b11134cd25baeb1d9 100644 (file)
@@ -38,7 +38,7 @@ public class MethodParameters extends Attribute {
        public MethodParameters(int index, int length, DataInputStream dis, ConstantPool cpool) throws IOException {
                super(Constants.ATTR_METHOD_PARAMETERS,index,length,cpool);
                data = new byte[length];
-               dis.read(data,0,length);
+               dis.readFully(data,0,length);
                isInPackedState = true;
        }
        
index c69b447cac0af92743a90d9f99d6a3a74ad6f45f..ac145087b75c3f2d44e9d25fb86b8a24f5a7cf19 100644 (file)
@@ -56,7 +56,7 @@ public abstract class RuntimeAnnos extends Attribute {
 
        protected void readAnnotations(DataInputStream dis, ConstantPool cpool) throws IOException {
                annotation_data = new byte[length];
-               dis.read(annotation_data, 0, length);
+               dis.readFully(annotation_data, 0, length);
        }
 
        protected void writeAnnotations(DataOutputStream dos) throws IOException {
index 650bd2625437c855665444549504ca80d4784b32..517ebee62ffd295a94fd7b6d28b68488701c700a 100644 (file)
@@ -80,7 +80,7 @@ public abstract class RuntimeParamAnnos extends Attribute {
 
        protected void readParameterAnnotations(DataInputStream dis,ConstantPool cpool) throws IOException {
                annotation_data = new byte[length];
-               dis.read(annotation_data,0,length);
+               dis.readFully(annotation_data,0,length);
        }
 
        private void inflate() {
index c783eae3b131c575642bb18db018e5784c7ba490..fb5c32ce1e4edfb29539d9f09a45f99e034a73dc 100644 (file)
@@ -34,7 +34,7 @@ public abstract class RuntimeTypeAnnos extends Attribute {
 
        protected void readTypeAnnotations(DataInputStream dis,ConstantPool cpool) throws IOException {
                annotation_data = new byte[length];
-               dis.read(annotation_data,0,length);
+               dis.readFully(annotation_data,0,length);
        }
 
        public final void dump(DataOutputStream dos) throws IOException {
index 55e904c39d9b86cd9234d9c8ad8493630ccc447d..c96574cdf3b76885f55024625c2ac3d410f37d57 100644 (file)
Binary files a/lib/bcel/bcel-src.zip and b/lib/bcel/bcel-src.zip differ
index 79ff2ae98ef5405f91d09f14cfbb99231979dc0f..5da57de723b8e601113d18a46ffd64683d7c8756 100644 (file)
Binary files a/lib/bcel/bcel.jar and b/lib/bcel/bcel.jar differ