Program: 65285
Project: 65285
Buggy source:
public static Object readObject(DataInputStream dis,Class fieldType,ClassLoader classLoader,int version) throws IOException, DataException {
  Object obj=null;
  char leadingChar=(char)dis.read();
  if (leadingChar == 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)) {
    if (version < VersionManager.VERSION_4_2_2) {
      int len=IOUtil.readInt(dis);
      if (len == 0) {
        obj=null;
      }
 else {
        byte[] bytes=new byte[len];
        dis.read(bytes);
        obj=bytes;
      }
    }
 else {
      int byteLength=leadingChar >> 1;
      if (byteLength >= 127) {
        byteLength=IOUtil.readInt(dis);
      }
      byte[] bytes=new byte[byteLength];
      dis.read(bytes);
      obj=bytes;
    }
  }
 else   if (fieldType.equals(int[].class)) {
    int[] result=new int[IOUtil.readInt(dis)];
    for (int i=0; i < result.length; i++) {
      result[i]=dis.readInt();
    }
    obj=result;
  }
 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;
}

Fixed version (ground truth):
public static Object readObject(DataInputStream dis,Class fieldType,ClassLoader classLoader,int version) throws IOException, DataException {
  Object obj=null;
  char leadingChar=(char)dis.read();
  if (leadingChar == 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)) {
    if (version < VersionManager.VERSION_4_2_2) {
      int len=IOUtil.readInt(dis);
      if (len == 0) {
        obj=null;
      }
 else {
        byte[] bytes=new byte[len];
        dis.read(bytes);
        obj=bytes;
      }
    }
 else {
      int byteLength=leadingChar >> 1;
      if (byteLength >= 127) {
        byteLength=IOUtil.readInt(dis);
      }
      byte[] bytes=new byte[byteLength];
      dis.readFully(bytes);
      obj=bytes;
    }
  }
 else   if (fieldType.equals(int[].class)) {
    int[] result=new int[IOUtil.readInt(dis)];
    for (int i=0; i < result.length; i++) {
      result[i]=dis.readInt();
    }
    obj=result;
  }
 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;
}