Program: 153271
Project: 153271
Buggy source:
static String processLogin(DataInputStream in,DataOutputStream out,PassthroughConnection ptc,KillableThread thread,boolean auth,ClientInfo clientInfo){
  Packet02Handshake CtSHandshake=new Packet02Handshake(in,ptc,thread);
  if (CtSHandshake.packetId == null || CtSHandshake.read(in,ptc,thread,true,null) == null) {
    return "String_Node_Str";
  }
  ptc.clientInfo.setUsername(CtSHandshake.getUsername());
  ptc.printLogMessage(CtSHandshake.getUsername() + "String_Node_Str");
  Packet02Handshake StCHandshake=new Packet02Handshake(out,ptc,thread);
  String hashString;
  if (auth) {
    hashString=getHashString();
    if (!Globals.isQuiet()) {
      ptc.printLogMessage("String_Node_Str" + hashString);
    }
  }
 else {
    hashString="String_Node_Str";
  }
  StCHandshake.setUsername(hashString);
  if (StCHandshake.packetId == null || StCHandshake.write(out,ptc,thread,false) == null) {
    return "String_Node_Str";
  }
  Packet01Login clientLogin=new Packet01Login(in,ptc,thread);
  if (clientLogin.packetId == null || clientLogin.read(in,ptc,thread,true,null) == null) {
    return "String_Node_Str";
  }
  String password=Globals.getPassword();
  boolean canSkipAuth=false;
  if (password != null && clientLogin.getVersion() == Globals.getFakeVersion()) {
    PacketFFKick fakeKickPacket=new PacketFFKick(out,ptc,thread);
    fakeKickPacket.setMessage("String_Node_Str");
    if (fakeKickPacket.packetId == null || fakeKickPacket.write(out,ptc,thread,false) == null) {
      return "String_Node_Str";
    }
    Packet02Handshake hashReply=new Packet02Handshake(in,ptc,thread);
    if (hashReply.packetId == null || hashReply.read(in,ptc,thread,true,null) == null) {
      return "String_Node_Str";
    }
    String toHash=hashString + password;
    String replyIdeal=sha1Hash(toHash).substring(0,24);
    String reply=hashReply.getUsername();
    if (!reply.equals(replyIdeal)) {
      return "String_Node_Str";
    }
    Packet02Handshake hostnameForward=new Packet02Handshake(in,ptc,thread);
    if (hostnameForward.packetId == null || hostnameForward.read(in,ptc,thread,true,null) == null) {
      return "String_Node_Str";
    }
    clientInfo.setForward(true);
    clientInfo.setHostname(hostnameForward.getUsername());
    canSkipAuth=true;
  }
 else   if (clientLogin.getVersion() != Globals.getClientVersion()) {
    return "String_Node_Str";
  }
  if (auth && !canSkipAuth) {
    if (!authenticate(ptc.clientInfo.getUsername(),hashString,ptc)) {
      return "String_Node_Str";
    }
  }
  return null;
}

Fixed version (ground truth):
static String processLogin(DataInputStream in,DataOutputStream out,PassthroughConnection ptc,KillableThread thread,boolean auth,ClientInfo clientInfo){
  Packet02Handshake CtSHandshake=new Packet02Handshake(in,ptc,thread);
  if (CtSHandshake.packetId == null || CtSHandshake.read(in,ptc,thread,true,null) == null) {
    return "String_Node_Str";
  }
  ptc.clientInfo.setUsername(CtSHandshake.getUsername());
  ptc.printLogMessage(CtSHandshake.getUsername() + "String_Node_Str");
  Packet02Handshake StCHandshake=new Packet02Handshake(out,ptc,thread);
  String hashString;
  if (auth) {
    hashString=getHashString();
    if (!Globals.isQuiet()) {
      ptc.printLogMessage("String_Node_Str" + hashString);
    }
  }
 else {
    hashString="String_Node_Str";
  }
  StCHandshake.setUsername(hashString);
  if (StCHandshake.packetId == null || StCHandshake.write(out,ptc,thread,false) == null) {
    return "String_Node_Str";
  }
  Packet01Login clientLogin=new Packet01Login(in,ptc,thread);
  if (clientLogin.packetId == null || clientLogin.read(in,ptc,thread,true,null) == null) {
    return "String_Node_Str";
  }
  String password=Globals.getPassword();
  boolean canSkipAuth=false;
  if (password != null && clientLogin.getVersion() == Globals.getFakeVersion()) {
    PacketFFKick fakeKickPacket=new PacketFFKick(out,ptc,thread);
    fakeKickPacket.setMessage("String_Node_Str");
    if (fakeKickPacket.packetId == null || fakeKickPacket.write(out,ptc,thread,false) == null) {
      return "String_Node_Str";
    }
    Packet02Handshake hashReply=new Packet02Handshake(in,ptc,thread);
    if (hashReply.packetId == null || hashReply.read(in,ptc,thread,true,null) == null) {
      return "String_Node_Str";
    }
    String toHash=hashString + password;
    String replyIdeal=sha1Hash(toHash).substring(0,16);
    String reply=hashReply.getUsername();
    if (!reply.equals(replyIdeal)) {
      return "String_Node_Str";
    }
    Packet02Handshake hostnameForward=new Packet02Handshake(in,ptc,thread);
    if (hostnameForward.packetId == null || hostnameForward.read(in,ptc,thread,true,null) == null) {
      return "String_Node_Str";
    }
    clientInfo.setForward(true);
    clientInfo.setHostname(hostnameForward.getUsername());
    canSkipAuth=true;
  }
 else   if (clientLogin.getVersion() != Globals.getClientVersion()) {
    return "String_Node_Str";
  }
  if (auth && !canSkipAuth) {
    if (!authenticate(ptc.clientInfo.getUsername(),hashString,ptc)) {
      return "String_Node_Str";
    }
  }
  return null;
}