Program: 34821
Project: 34821
Buggy source:
private static String readUTF(DataInput in) throws IOException {
  int utflen=in.readInt();
  byte[] bytearr;
  char[] chararr;
  try {
    bytearr=new byte[utflen];
    chararr=new char[utflen];
  }
 catch (  OutOfMemoryError e) {
    final IOException ex=new IOException("String_Node_Str" + "String_Node_Str");
    ex.initCause(e);
    throw ex;
  }
  int c, char2, char3;
  int count=0;
  int chararr_count=0;
  in.readFully(bytearr,0,utflen);
  while (count < utflen) {
    c=bytearr[count] & 0xff;
    if (c > 127) {
      break;
    }
    count++;
    chararr[chararr_count++]=(char)c;
  }
  while (count < utflen) {
    c=bytearr[count] & 0xff;
switch (c >> 4) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
      count++;
    chararr[chararr_count++]=(char)c;
  break;
case 12:
case 13:
count+=2;
if (count > utflen) {
throw new UTFDataFormatException("String_Node_Str");
}
char2=bytearr[count - 1];
if ((char2 & 0xC0) != 0x80) {
throw new UTFDataFormatException("String_Node_Str" + count);
}
chararr[chararr_count++]=(char)(((c & 0x1F) << 6) | (char2 & 0x3F));
break;
case 14:
count+=3;
if (count > utflen) {
throw new UTFDataFormatException("String_Node_Str");
}
char2=bytearr[count - 2];
char3=bytearr[count - 1];
if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80)) {
throw new UTFDataFormatException("String_Node_Str" + (count - 1));
}
chararr[chararr_count++]=(char)(((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0));
break;
default :
throw new UTFDataFormatException("String_Node_Str" + count);
}
}
return new String(chararr,0,chararr_count);
}

Fixed version (ground truth):
private static String readUTF(DataInput in) throws IOException {
  int utflen=in.readInt();
  byte[] bytearr;
  char[] chararr;
  try {
    bytearr=new byte[utflen];
    chararr=new char[utflen];
  }
 catch (  OutOfMemoryError e) {
    final IOException ex=new IOException("String_Node_Str" + "String_Node_Str");
    ex.initCause(e);
    throw ex;
  }
  int c, char2, char3;
  int count=0;
  int chararrCount=0;
  in.readFully(bytearr,0,utflen);
  while (count < utflen) {
    c=bytearr[count] & 0xff;
    if (c > 127) {
      break;
    }
    count++;
    chararr[chararrCount++]=(char)c;
  }
  while (count < utflen) {
    c=bytearr[count] & 0xff;
switch (c >> 4) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
      count++;
    chararr[chararrCount++]=(char)c;
  break;
case 12:
case 13:
count+=2;
if (count > utflen) {
throw new UTFDataFormatException("String_Node_Str");
}
char2=bytearr[count - 1];
if ((char2 & 0xC0) != 0x80) {
throw new UTFDataFormatException("String_Node_Str" + count);
}
chararr[chararrCount++]=(char)(((c & 0x1F) << 6) | (char2 & 0x3F));
break;
case 14:
count+=3;
if (count > utflen) {
throw new UTFDataFormatException("String_Node_Str");
}
char2=bytearr[count - 2];
char3=bytearr[count - 1];
if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80)) {
throw new UTFDataFormatException("String_Node_Str" + (count - 1));
}
chararr[chararrCount++]=(char)(((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0));
break;
default :
throw new UTFDataFormatException("String_Node_Str" + count);
}
}
return new String(chararr,0,chararrCount);
}