Program: 187411
Project: 187411
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Bundle bundle=intent.getExtras();
  if (bundle != null) {
    Object[] pdus=(Object[])bundle.get("String_Node_Str");
    final SmsMessage[] messages=new SmsMessage[pdus.length];
    for (int i=0; i < pdus.length; i++) {
      messages[i]=SmsMessage.createFromPdu((byte[])pdus[i]);
    }
    if (messages.length > -1) {
      if (MessageService.dba == null) {
        MessageService.dba=new DBAccessor(context);
      }
      String address=messages[0].getOriginatingAddress();
      String secretMessage=null;
      if (MessageService.dba.inDatabase(address)) {
        if (MessageService.dba.isTrustedContact((address))) {
          try {
            Prephase3Activity.sendToSelf(context,messages[0].getOriginatingAddress(),messages[0].getMessageBody(),Prephase3Activity.INBOX);
            secretMessage=Encryption.aes_decrypt(MessageService.dba.getRow(ContactRetriever.format(address)).getPublicKey(),messages[0].getMessageBody());
            Prephase3Activity.sendToSelf(context,messages[0].getOriginatingAddress(),secretMessage,Prephase3Activity.INBOX);
            MessageService.dba.updateLastMessage(new Number(address,1,secretMessage));
            Prephase3Activity.updateList(context);
          }
 catch (          Exception e) {
            Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
            e.printStackTrace();
          }
        }
 else {
          Prephase3Activity.sendToSelf(context,messages[0].getOriginatingAddress(),messages[0].getMessageBody(),Prephase3Activity.INBOX);
          Prephase3Activity.updateList(context);
        }
        MessageService.contentTitle=MessageService.dba.getRow(ContactRetriever.format(address)).getName();
        if (secretMessage != null) {
          MessageService.contentText=secretMessage;
        }
 else {
          MessageService.contentText=messages[0].getMessageBody();
        }
        Intent serviceIntent=new Intent(context,MessageService.class);
        context.startService(serviceIntent);
        this.abortBroadcast();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Bundle bundle=intent.getExtras();
  if (bundle != null) {
    Object[] pdus=(Object[])bundle.get("String_Node_Str");
    final SmsMessage[] messages=new SmsMessage[pdus.length];
    for (int i=0; i < pdus.length; i++) {
      messages[i]=SmsMessage.createFromPdu((byte[])pdus[i]);
    }
    if (messages.length > -1) {
      if (MessageService.dba == null) {
        MessageService.dba=new DBAccessor(context);
      }
      String address=messages[0].getOriginatingAddress();
      String secretMessage=null;
      if (MessageService.dba.inDatabase(address)) {
        if (MessageService.dba.isTrustedContact((address))) {
          try {
            Prephase3Activity.sendToSelf(context,messages[0].getOriginatingAddress(),messages[0].getMessageBody(),Prephase3Activity.INBOX);
            secretMessage=Encryption.aes_decrypt(MessageService.dba.getRow(ContactRetriever.format(address)).getPublicKey(),messages[0].getMessageBody());
            Prephase3Activity.sendToSelf(context,messages[0].getOriginatingAddress(),secretMessage,Prephase3Activity.INBOX);
            MessageService.dba.updateLastMessage(new Number(address,secretMessage));
            Prephase3Activity.updateList(context);
          }
 catch (          Exception e) {
            Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
            e.printStackTrace();
          }
        }
 else {
          Prephase3Activity.sendToSelf(context,address,messages[0].getMessageBody(),Prephase3Activity.INBOX);
          MessageService.dba.updateLastMessage(new Number(address,messages[0].getMessageBody()));
          Prephase3Activity.updateList(context);
        }
        MessageService.contentTitle=ContactRetriever.format(address);
        if (secretMessage != null) {
          MessageService.contentText=secretMessage;
        }
 else {
          MessageService.contentText=messages[0].getMessageBody();
        }
        Intent serviceIntent=new Intent(context,MessageService.class);
        context.startService(serviceIntent);
        this.abortBroadcast();
      }
    }
  }
}