Program: 65746
Project: 65746
Buggy source:
public static Object readObject(DataInputStream dis,Class fieldType,ClassLoader classLoader) throws IOException, DataException {
  Object obj=null;
  if (dis.readByte() == 0) {
    obj=null;
    return obj;
  }
  if (fieldType.equals(Integer.class))   obj=Integer.valueOf(dis.readInt());
 else   if (fieldType.equals(Double.class))   obj=new Double(dis.readDouble());
 else   if (fieldType.equals(BigDecimal.class))   obj=new BigDecimal(dis.readUTF());
 else   if (fieldType.equals(Time.class))   obj=new Time(dis.readLong());
 else   if (fieldType.equals(Timestamp.class))   obj=new Timestamp(dis.readLong());
 else   if (fieldType.equals(java.sql.Date.class))   obj=new java.sql.Date(dis.readLong());
 else   if (Date.class.isAssignableFrom(fieldType))   obj=new Date(dis.readLong());
 else   if (fieldType.equals(Boolean.class))   obj=Boolean.valueOf(dis.readBoolean());
 else   if (fieldType.equals(String.class))   obj=IOUtil.readString(dis);
 else   if (fieldType.equals(IClob.class) || fieldType.equals(Clob.class))   obj=IOUtil.readString(dis);
 else   if (fieldType.equals(IBlob.class) || fieldType.equals(Blob.class)) {
    int len=IOUtil.readInt(dis);
    if (len == 0) {
      obj=null;
    }
 else {
      byte[] bytes=new byte[len];
      dis.read(bytes);
      obj=bytes;
    }
  }
 else   if (fieldType.equals(Object.class) || fieldType.equals(DataType.getClass(DataType.ANY_TYPE))) {
    ObjectInputStream ois=null;
    if (classLoader != null) {
      ois=ObjectSecurity.createObjectInputStream(dis,classLoader);
    }
 else {
      ois=ObjectSecurity.createObjectInputStream(dis);
    }
    try {
      obj=ObjectSecurity.readObject(ois);
    }
 catch (    Exception e) {
    }
    ois.close();
  }
 else {
    throw new DataException(ResourceConstants.BAD_DATA_TYPE,fieldType.toString());
  }
  return obj;
}

Fixed version (ground truth):
public static Object readObject(DataInputStream dis,Class fieldType,ClassLoader classLoader) throws IOException, DataException {
  Object obj=null;
  if (dis.readByte() == 0) {
    obj=null;
    return obj;
  }
  if (fieldType.equals(Integer.class))   obj=Integer.valueOf(dis.readInt());
 else   if (fieldType.equals(Double.class))   obj=new Double(dis.readDouble());
 else   if (fieldType.equals(BigDecimal.class))   obj=new BigDecimal(dis.readUTF());
 else   if (fieldType.equals(Time.class))   obj=new Time(dis.readLong());
 else   if (fieldType.equals(Timestamp.class))   obj=new Timestamp(dis.readLong());
 else   if (fieldType.equals(java.sql.Date.class))   obj=new java.sql.Date(dis.readLong());
 else   if (Date.class.isAssignableFrom(fieldType))   obj=new Date(dis.readLong());
 else   if (fieldType.equals(Boolean.class))   obj=Boolean.valueOf(dis.readBoolean());
 else   if (fieldType.equals(String.class))   obj=IOUtil.readString(dis);
 else   if (fieldType.equals(IClob.class) || fieldType.equals(Clob.class))   obj=IOUtil.readString(dis);
 else   if (fieldType.equals(IBlob.class) || fieldType.equals(Blob.class)) {
    int len=IOUtil.readInt(dis);
    if (len == 0) {
      obj=null;
    }
 else {
      byte[] bytes=new byte[len];
      dis.read(bytes);
      obj=bytes;
    }
  }
 else   if (fieldType.equals(Object.class) || fieldType.equals(DataType.getClass(DataType.ANY_TYPE))) {
    obj=IOUtil.readObject(dis,classLoader);
  }
 else {
    throw new DataException(ResourceConstants.BAD_DATA_TYPE,fieldType.toString());
  }
  return obj;
}