Program: 184767
Project: 184767
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == VOICEMAIL_PROVIDER_CFG_ID) {
    boolean failure=false;
    if (DBG)     log("String_Node_Str" + mVMProviderSettingsForced);
    final boolean isVMProviderSettingsForced=mVMProviderSettingsForced;
    mVMProviderSettingsForced=false;
    if (resultCode != RESULT_OK) {
      if (DBG)       log("String_Node_Str");
      failure=true;
    }
    if (data == null) {
      if (DBG)       log("String_Node_Str");
      failure=true;
    }
    if (data.getBooleanExtra(SIGNOUT_EXTRA,false)) {
      if (DBG)       log("String_Node_Str");
      if (isVMProviderSettingsForced) {
        if (DBG)         log("String_Node_Str");
        switchToPreviousVoicemailProvider();
      }
 else {
        final String victim=mVoicemailProviders.getValue();
        if (DBG)         log("String_Node_Str" + victim);
        Intent i=new Intent(ACTION_ADD_VOICEMAIL);
        i.putExtra(IGNORE_PROVIDER_EXTRA,victim);
        i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        this.startActivity(i);
      }
      return;
    }
    String vmNum=data.getStringExtra(VM_NUMBER_EXTRA);
    if (vmNum == null || vmNum.length() == 0) {
      if (DBG)       log("String_Node_Str");
      failure=true;
    }
    if (failure) {
      if (DBG)       log("String_Node_Str");
      if (isVMProviderSettingsForced) {
        switchToPreviousVoicemailProvider();
      }
 else {
        if (DBG)         log("String_Node_Str");
      }
      return;
    }
    final String fwdNum=data.getStringExtra(FWD_NUMBER_EXTRA);
    final int fwdNumTime=data.getIntExtra(FWD_NUMBER_TIME_EXTRA,20);
    if (DBG)     log("String_Node_Str" + (fwdNum != null ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
    saveVoiceMailAndForwardingNumber(mVoicemailProviders.getValue(),new VoiceMailProviderSettings(vmNum,(String)fwdNum,fwdNumTime));
    return;
  }
  if (resultCode != RESULT_OK) {
    if (DBG)     log("String_Node_Str");
    return;
  }
  Cursor cursor=getContentResolver().query(data.getData(),NUM_PROJECTION,null,null,null);
  if ((cursor == null) || (!cursor.moveToFirst())) {
    if (DBG)     log("String_Node_Str");
    return;
  }
switch (requestCode) {
case VOICEMAIL_PREF_ID:
    mSubMenuVoicemailSettings.onPickActivityResult(cursor.getString(0));
  break;
default :
}
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == VOICEMAIL_PROVIDER_CFG_ID) {
    boolean failure=false;
    if (DBG)     log("String_Node_Str" + mVMProviderSettingsForced);
    final boolean isVMProviderSettingsForced=mVMProviderSettingsForced;
    mVMProviderSettingsForced=false;
    String vmNum=null;
    if (resultCode != RESULT_OK) {
      if (DBG)       log("String_Node_Str");
      failure=true;
    }
 else {
      if (data == null) {
        if (DBG)         log("String_Node_Str");
        failure=true;
      }
 else {
        if (data.getBooleanExtra(SIGNOUT_EXTRA,false)) {
          if (DBG)           log("String_Node_Str");
          if (isVMProviderSettingsForced) {
            if (DBG)             log("String_Node_Str");
            switchToPreviousVoicemailProvider();
          }
 else {
            final String victim=getCurrentVoicemailProviderKey();
            if (DBG)             log("String_Node_Str" + victim);
            Intent i=new Intent(ACTION_ADD_VOICEMAIL);
            i.putExtra(IGNORE_PROVIDER_EXTRA,victim);
            i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            this.startActivity(i);
          }
          return;
        }
        vmNum=data.getStringExtra(VM_NUMBER_EXTRA);
        if (vmNum == null || vmNum.length() == 0) {
          if (DBG)           log("String_Node_Str");
          failure=true;
        }
      }
    }
    if (failure) {
      if (DBG)       log("String_Node_Str");
      if (isVMProviderSettingsForced) {
        switchToPreviousVoicemailProvider();
      }
 else {
        if (DBG)         log("String_Node_Str");
      }
      return;
    }
    final String fwdNum=data.getStringExtra(FWD_NUMBER_EXTRA);
    final int fwdNumTime=data.getIntExtra(FWD_NUMBER_TIME_EXTRA,20);
    if (DBG)     log("String_Node_Str" + (fwdNum != null ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
    saveVoiceMailAndForwardingNumber(getCurrentVoicemailProviderKey(),new VoiceMailProviderSettings(vmNum,(String)fwdNum,fwdNumTime));
    return;
  }
  if (resultCode != RESULT_OK) {
    if (DBG)     log("String_Node_Str");
    return;
  }
  Cursor cursor=getContentResolver().query(data.getData(),NUM_PROJECTION,null,null,null);
  if ((cursor == null) || (!cursor.moveToFirst())) {
    if (DBG)     log("String_Node_Str");
    return;
  }
switch (requestCode) {
case VOICEMAIL_PREF_ID:
    mSubMenuVoicemailSettings.onPickActivityResult(cursor.getString(0));
  break;
default :
}
}