Program: 43015
Project: 43015
Buggy source:
/** 
 * Read the given number of characters from the given byte input.  The length given is in characters, <b>NOT</b> in bytes.
 * @param input the byte source
 * @param len the number of characters to read
 * @return the string
 * @throws IOException if an I/O error occurs
 */
public static String readUTFBytes(final ByteInput input,final int len) throws IOException {
  final byte[] byteBuf=BYTES_HOLDER.get();
  final char[] chars=new char[len];
  int i=0, cnt=0, charIdx=0;
  cnt=input.read(byteBuf,0,Math.min(UTF_BUFS_BYTE_CNT,len - charIdx));
  if (cnt < 0) {
    throw new EOFException();
  }
  while (charIdx < len) {
    final int a=byteBuf[i++] & 0xff;
    if (a < 0x80) {
      chars[charIdx++]=(char)a;
    }
 else     if (a < 0xc0) {
      throw new UTFDataFormatException(INVALID_BYTE);
    }
 else     if (a < 0xe0) {
      if (i == cnt) {
        cnt=input.read(byteBuf,0,Math.min(UTF_BUFS_BYTE_CNT,len - charIdx));
        if (cnt < 0) {
          throw new EOFException();
        }
        i=0;
      }
      final int b=byteBuf[i++] & 0xff;
      if ((a & 0xc0) != 0x80) {
        throw new UTFDataFormatException(INVALID_BYTE);
      }
      chars[charIdx++]=(char)((a & 0x1f) << 6 | b & 0x3f);
    }
 else     if (a < 0xf0) {
      if (i == cnt) {
        cnt=input.read(byteBuf,0,Math.min(UTF_BUFS_BYTE_CNT,len - charIdx));
        if (cnt < 0) {
          throw new EOFException();
        }
        i=0;
      }
      final int b=byteBuf[i++] & 0xff;
      if ((b & 0xc0) != 0x80) {
        throw new UTFDataFormatException(INVALID_BYTE);
      }
      if (i == cnt) {
        cnt=input.read(byteBuf,0,Math.min(UTF_BUFS_BYTE_CNT,len - charIdx));
        if (cnt < 0) {
          throw new EOFException();
        }
        i=0;
      }
      final int c=byteBuf[i++] & 0xff;
      if ((c & 0xc0) != 0x80) {
        throw new UTFDataFormatException(INVALID_BYTE);
      }
      chars[charIdx++]=(char)((a & 0x0f) << 12 | (b & 0x3f) << 6 | c & 0x3f);
    }
 else {
      throw new UTFDataFormatException(INVALID_BYTE);
    }
  }
  return String.valueOf(chars);
}

Fixed version (ground truth):
/** 
 * Read the given number of characters from the given byte input.  The length given is in characters, <b>NOT</b> in bytes.
 * @param input the byte source
 * @param len the number of characters to read
 * @return the string
 * @throws IOException if an I/O error occurs
 */
public static String readUTFBytes(final ByteInput input,final int len) throws IOException {
  final byte[] byteBuf=BYTES_HOLDER.get();
  final char[] chars=new char[len];
  int i=0, cnt=0, charIdx=0;
  while (charIdx < len) {
    if (i == cnt) {
      cnt=input.read(byteBuf,0,Math.min(UTF_BUFS_BYTE_CNT,len - charIdx));
      if (cnt < 0) {
        throw new EOFException();
      }
      i=0;
    }
    final int a=byteBuf[i++] & 0xff;
    if (a < 0x80) {
      chars[charIdx++]=(char)a;
    }
 else     if (a < 0xc0) {
      throw new UTFDataFormatException(INVALID_BYTE);
    }
 else     if (a < 0xe0) {
      if (i == cnt) {
        cnt=input.read(byteBuf,0,Math.min(UTF_BUFS_BYTE_CNT,len - charIdx));
        if (cnt < 0) {
          throw new EOFException();
        }
        i=0;
      }
      final int b=byteBuf[i++] & 0xff;
      if ((b & 0xc0) != 0x80) {
        throw new UTFDataFormatException(INVALID_BYTE);
      }
      chars[charIdx++]=(char)((a & 0x1f) << 6 | b & 0x3f);
    }
 else     if (a < 0xf0) {
      if (i == cnt) {
        cnt=input.read(byteBuf,0,Math.min(UTF_BUFS_BYTE_CNT,len - charIdx));
        if (cnt < 0) {
          throw new EOFException();
        }
        i=0;
      }
      final int b=byteBuf[i++] & 0xff;
      if ((b & 0xc0) != 0x80) {
        throw new UTFDataFormatException(INVALID_BYTE);
      }
      if (i == cnt) {
        cnt=input.read(byteBuf,0,Math.min(UTF_BUFS_BYTE_CNT,len - charIdx));
        if (cnt < 0) {
          throw new EOFException();
        }
        i=0;
      }
      final int c=byteBuf[i++] & 0xff;
      if ((c & 0xc0) != 0x80) {
        throw new UTFDataFormatException(INVALID_BYTE);
      }
      chars[charIdx++]=(char)((a & 0x0f) << 12 | (b & 0x3f) << 6 | c & 0x3f);
    }
 else {
      throw new UTFDataFormatException(INVALID_BYTE);
    }
  }
  return String.valueOf(chars);
}