Program: 187890
Project: 187890
Buggy source:
private Intent getSetPassword(Intent thisIntent,Intent callbackIntent) throws CryptoHelperException, Exception {
  String action=thisIntent.getAction();
  Log.d(TAG,"String_Node_Str");
  String username=null;
  String password=null;
  String clearUniqueName=thisIntent.getStringExtra(CryptoIntents.EXTRA_UNIQUE_NAME);
  if (clearUniqueName == null)   throw new Exception("String_Node_Str");
  String uniqueName=ch.encrypt(clearUniqueName);
  PassEntry row=dbHelper.fetchPassword(uniqueName);
  boolean passExists=row.id > 1;
  String clearCallingPackage=getCallingPackage();
  String callingPackage=ch.encrypt(clearCallingPackage);
  if (passExists) {
    ArrayList<String> packageAccess=dbHelper.fetchPackageAccess(row.id);
    if (!PassEntry.checkPackageAccess(packageAccess,callingPackage)) {
      throw new Exception("String_Node_Str");
    }
  }
  if (action.equals(CryptoIntents.ACTION_GET_PASSWORD)) {
    if (passExists) {
      username=ch.decrypt(row.username);
      password=ch.decrypt(row.password);
    }
 else     throw new Exception("String_Node_Str" + clearUniqueName);
    callbackIntent.putExtra(CryptoIntents.EXTRA_USERNAME,username);
    callbackIntent.putExtra(CryptoIntents.EXTRA_PASSWORD,password);
  }
 else   if (action.equals(CryptoIntents.ACTION_SET_PASSWORD)) {
    String clearUsername=thisIntent.getStringExtra(CryptoIntents.EXTRA_USERNAME);
    String clearPassword=thisIntent.getStringExtra(CryptoIntents.EXTRA_PASSWORD);
    if (clearPassword == null) {
      throw new Exception("String_Node_Str");
    }
    row.username=ch.encrypt(clearUsername == null ? "String_Node_Str" : clearUsername);
    row.password=ch.encrypt(clearPassword);
    if (passExists) {
      if (clearUsername.equals("String_Node_Str") && clearPassword.equals("String_Node_Str")) {
        dbHelper.deletePassword(row.id);
      }
 else {
        dbHelper.updatePassword(row.id,row);
      }
    }
 else {
      row.uniqueName=uniqueName;
      row.description=uniqueName;
      row.website="String_Node_Str";
      row.note="String_Node_Str";
      String category=ch.encrypt("String_Node_Str");
      CategoryEntry c=new CategoryEntry();
      c.name=category;
      row.category=dbHelper.addCategory(c);
      row.id=dbHelper.addPassword(row);
    }
    dbHelper.addPackageAccess(row.id,callingPackage);
  }
  return (callbackIntent);
}

Fixed version (ground truth):
private Intent getSetPassword(Intent thisIntent,Intent callbackIntent) throws CryptoHelperException, Exception {
  String action=thisIntent.getAction();
  Log.d(TAG,"String_Node_Str");
  String username=null;
  String password=null;
  String clearUniqueName=thisIntent.getStringExtra(CryptoIntents.EXTRA_UNIQUE_NAME);
  if (clearUniqueName == null)   throw new Exception("String_Node_Str");
  if (dbHelper == null) {
    dbHelper=new DBHelper(this);
  }
  String uniqueName=ch.encrypt(clearUniqueName);
  PassEntry row=dbHelper.fetchPassword(uniqueName);
  boolean passExists=row.id > 1;
  String clearCallingPackage=getCallingPackage();
  String callingPackage=ch.encrypt(clearCallingPackage);
  if (passExists) {
    ArrayList<String> packageAccess=dbHelper.fetchPackageAccess(row.id);
    if (!PassEntry.checkPackageAccess(packageAccess,callingPackage)) {
      throw new Exception("String_Node_Str");
    }
  }
  if (action.equals(CryptoIntents.ACTION_GET_PASSWORD)) {
    if (passExists) {
      username=ch.decrypt(row.username);
      password=ch.decrypt(row.password);
    }
 else     throw new Exception("String_Node_Str" + clearUniqueName);
    callbackIntent.putExtra(CryptoIntents.EXTRA_USERNAME,username);
    callbackIntent.putExtra(CryptoIntents.EXTRA_PASSWORD,password);
  }
 else   if (action.equals(CryptoIntents.ACTION_SET_PASSWORD)) {
    String clearUsername=thisIntent.getStringExtra(CryptoIntents.EXTRA_USERNAME);
    String clearPassword=thisIntent.getStringExtra(CryptoIntents.EXTRA_PASSWORD);
    if (clearPassword == null) {
      throw new Exception("String_Node_Str");
    }
    row.username=ch.encrypt(clearUsername == null ? "String_Node_Str" : clearUsername);
    row.password=ch.encrypt(clearPassword);
    if (passExists) {
      if (clearUsername.equals("String_Node_Str") && clearPassword.equals("String_Node_Str")) {
        dbHelper.deletePassword(row.id);
      }
 else {
        dbHelper.updatePassword(row.id,row);
      }
    }
 else {
      row.uniqueName=uniqueName;
      row.description=uniqueName;
      row.website="String_Node_Str";
      row.note="String_Node_Str";
      String category=ch.encrypt("String_Node_Str");
      CategoryEntry c=new CategoryEntry();
      c.name=category;
      row.category=dbHelper.addCategory(c);
      row.id=dbHelper.addPassword(row);
    }
    dbHelper.addPackageAccess(row.id,callingPackage);
  }
  return (callbackIntent);
}