Browse Source

Fix 487927: ClassFormatException if LocalVariableTable data cannot be fully read

tags/V1_8_9
Andy Clement 8 years ago
parent
commit
3274cbbc06

+ 1
- 1
bcel-builder/src/org/aspectj/apache/bcel/classfile/BootstrapMethods.java View 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;
}

+ 1
- 1
bcel-builder/src/org/aspectj/apache/bcel/classfile/LineNumberTable.java View 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)
}

+ 1
- 1
bcel-builder/src/org/aspectj/apache/bcel/classfile/LocalVariableTable.java View 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)
}

+ 1
- 1
bcel-builder/src/org/aspectj/apache/bcel/classfile/MethodParameters.java View 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;
}

+ 1
- 1
bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java View 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 {

+ 1
- 1
bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java View 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() {

+ 1
- 1
bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/RuntimeTypeAnnos.java View 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 {

BIN
lib/bcel/bcel-src.zip View File


BIN
lib/bcel/bcel.jar View File


Loading…
Cancel
Save