Program: 94923
Project: 94923
Buggy source:
/** 
 * Retrieves the client ticket that is associated with the given username, password, and challenge string.
 * @param username the user's email address
 * @param password the user's password
 * @param challengeString the challenge string received from the notification session
 * @return the client ticket
 * @throws IOException If an I/O error occurs while connecting to the Passport Nexus page or when getting the response codes from the connection
 */
public synchronized String getTicket(String username,String password,String challengeString) throws IOException {
  if (getLoginServerAddress()) {
    username=URLEncoder.encode(username);
    password=URLEncoder.encode(password);
    try {
      while (!cancelled) {
        request=(HttpURLConnection)new URL(daLoginURL).openConnection();
        request.setRequestProperty("String_Node_Str","String_Node_Str" + username + "String_Node_Str"+ password+ ','+ challengeString);
        if (request.getResponseCode() == HttpURLConnection.HTTP_OK) {
          password=null;
          String authenticationInfo=request.getHeaderField("String_Node_Str");
          int start=authenticationInfo.indexOf('\'');
          int end=authenticationInfo.lastIndexOf('\'');
          request.disconnect();
          return authenticationInfo.substring(start + 1,end);
        }
 else         if (request.getResponseCode() == HttpURLConnection.HTTP_MOVED_TEMP) {
          daLoginURL=request.getHeaderField("String_Node_Str");
          daLoginURL=daLoginURL.substring(1,daLoginURL.length() - 1);
        }
      }
    }
 catch (    Exception e) {
      if (request.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) {
        return "String_Node_Str";
      }
      e.printStackTrace();
    }
 finally {
      request.disconnect();
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Retrieves the client ticket that is associated with the given username, password, and challenge string.
 * @param username the user's email address
 * @param password the user's password
 * @param challengeString the challenge string received from the notification session
 * @return the client ticket if login info is correct, <code>null</code> otherwise
 * @throws IOException If an I/O error occurs while connecting to the Passport Nexus page or when getting the response codes from the connection
 */
public synchronized String getTicket(String username,String password,String challengeString) throws IOException {
  if (getLoginServerAddress()) {
    username=URLEncoder.encode(username);
    password=URLEncoder.encode(password);
    try {
      while (!cancelled) {
        request=(HttpURLConnection)new URL(daLoginURL).openConnection();
        request.setRequestProperty("String_Node_Str","String_Node_Str" + username + "String_Node_Str"+ password+ ','+ challengeString);
        if (request.getResponseCode() == HttpURLConnection.HTTP_OK) {
          password=null;
          String authenticationInfo=request.getHeaderField("String_Node_Str");
          int start=authenticationInfo.indexOf('\'');
          int end=authenticationInfo.lastIndexOf('\'');
          request.disconnect();
          return authenticationInfo.substring(start + 1,end);
        }
 else         if (request.getResponseCode() == HttpURLConnection.HTTP_MOVED_TEMP) {
          daLoginURL=request.getHeaderField("String_Node_Str");
          daLoginURL=daLoginURL.substring(1,daLoginURL.length() - 1);
        }
 else         if (request.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) {
          request.disconnect();
          return null;
        }
      }
    }
 catch (    Exception e) {
      if (request.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) {
        return "String_Node_Str";
      }
      e.printStackTrace();
    }
 finally {
      request.disconnect();
    }
  }
  return "String_Node_Str";
}