From: Andy Clement Date: Thu, 18 Feb 2016 20:23:24 +0000 (-0800) Subject: Fix 487927: ClassFormatException if LocalVariableTable data cannot be fully read X-Git-Tag: V1_8_9~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3274cbbc06a28ceea357acdd2538f4cf04e95d2e;p=aspectj.git Fix 487927: ClassFormatException if LocalVariableTable data cannot be fully read --- diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/BootstrapMethods.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/BootstrapMethods.java index a5216f2ef..f708c0cab 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/BootstrapMethods.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/BootstrapMethods.java @@ -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; } diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/LineNumberTable.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/LineNumberTable.java index 10d72fd3e..871bfe6bf 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/LineNumberTable.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/LineNumberTable.java @@ -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) } diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/LocalVariableTable.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/LocalVariableTable.java index 717bb5965..e6415dae6 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/LocalVariableTable.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/LocalVariableTable.java @@ -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) } diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/MethodParameters.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/MethodParameters.java index 76f1642d5..547041584 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/MethodParameters.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/MethodParameters.java @@ -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; } diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java index c69b447ca..ac145087b 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java @@ -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 { diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java index 650bd2625..517ebee62 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java @@ -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() { diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeTypeAnnos.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeTypeAnnos.java index c783eae3b..fb5c32ce1 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeTypeAnnos.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeTypeAnnos.java @@ -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 { diff --git a/lib/bcel/bcel-src.zip b/lib/bcel/bcel-src.zip index 55e904c39..c96574cdf 100644 Binary files a/lib/bcel/bcel-src.zip and b/lib/bcel/bcel-src.zip differ diff --git a/lib/bcel/bcel.jar b/lib/bcel/bcel.jar index 79ff2ae98..5da57de72 100644 Binary files a/lib/bcel/bcel.jar and b/lib/bcel/bcel.jar differ