Program: 943
Project: 943
Buggy source:
private final void deliverToRegisteredReceiverLocked(BroadcastRecord r,BroadcastFilter filter,boolean ordered){
  boolean skip=false;
  if (filter.requiredPermission != null) {
    int perm=mService.checkComponentPermission(filter.requiredPermission,r.callingPid,r.callingUid,-1,true);
    if (perm != PackageManager.PERMISSION_GRANTED) {
      Slog.w(TAG,"String_Node_Str" + r.intent.toString() + "String_Node_Str"+ r.callerPackage+ "String_Node_Str"+ r.callingPid+ "String_Node_Str"+ r.callingUid+ "String_Node_Str"+ "String_Node_Str"+ filter.requiredPermission+ "String_Node_Str"+ filter);
      skip=true;
    }
  }
  if (!skip && r.requiredPermission != null) {
    int perm=mService.checkComponentPermission(r.requiredPermission,filter.receiverList.pid,filter.receiverList.uid,-1,true);
    if (perm != PackageManager.PERMISSION_GRANTED) {
      Slog.w(TAG,"String_Node_Str" + r.intent.toString() + "String_Node_Str"+ filter.receiverList.app+ "String_Node_Str"+ filter.receiverList.pid+ "String_Node_Str"+ filter.receiverList.uid+ "String_Node_Str"+ "String_Node_Str"+ r.requiredPermission+ "String_Node_Str"+ r.callerPackage+ "String_Node_Str"+ r.callingUid+ "String_Node_Str");
      skip=true;
    }
  }
  if (r.appOp != AppOpsManager.OP_NONE) {
    int mode=mService.mAppOpsService.noteOperation(r.appOp,filter.receiverList.uid,filter.packageName);
    if (mode != AppOpsManager.MODE_ALLOWED) {
      if (DEBUG_BROADCAST)       Slog.v(TAG,"String_Node_Str" + r.appOp + "String_Node_Str"+ filter.receiverList.uid+ "String_Node_Str"+ filter.packageName);
      skip=true;
    }
  }
  if (!skip) {
    skip=!mService.mIntentFirewall.checkBroadcast(r.intent,r.callingUid,r.callingPid,r.resolvedType,filter.receiverList.uid);
  }
  if (!skip) {
    if (ordered) {
      r.receiver=filter.receiverList.receiver.asBinder();
      r.curFilter=filter;
      filter.receiverList.curBroadcast=r;
      r.state=BroadcastRecord.CALL_IN_RECEIVE;
      if (filter.receiverList.app != null) {
        r.curApp=filter.receiverList.app;
        filter.receiverList.app.curReceiver=r;
        mService.updateOomAdjLocked(r.curApp,true);
      }
    }
    try {
      if (DEBUG_BROADCAST_LIGHT) {
        int seq=r.intent.getIntExtra("String_Node_Str",-1);
        Slog.i(TAG,"String_Node_Str" + filter + "String_Node_Str"+ seq+ "String_Node_Str"+ r);
      }
      performReceiveLocked(filter.receiverList.app,filter.receiverList.receiver,new Intent(r.intent),r.resultCode,r.resultData,r.resultExtras,r.ordered,r.initialSticky,r.userId);
      if (ordered) {
        r.state=BroadcastRecord.CALL_DONE_RECEIVE;
      }
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str" + r.intent,e);
      if (ordered) {
        r.receiver=null;
        r.curFilter=null;
        filter.receiverList.curBroadcast=null;
        if (filter.receiverList.app != null) {
          filter.receiverList.app.curReceiver=null;
        }
      }
    }
  }
}

Fixed version (ground truth):
private final void deliverToRegisteredReceiverLocked(BroadcastRecord r,BroadcastFilter filter,boolean ordered){
  boolean skip=false;
  if (filter.requiredPermission != null) {
    int perm=mService.checkComponentPermission(filter.requiredPermission,r.callingPid,r.callingUid,-1,true);
    if (perm != PackageManager.PERMISSION_GRANTED) {
      Slog.w(TAG,"String_Node_Str" + r.intent.toString() + "String_Node_Str"+ r.callerPackage+ "String_Node_Str"+ r.callingPid+ "String_Node_Str"+ r.callingUid+ "String_Node_Str"+ "String_Node_Str"+ filter.requiredPermission+ "String_Node_Str"+ filter);
      skip=true;
    }
  }
  if (!skip && r.requiredPermission != null) {
    int perm=mService.checkComponentPermission(r.requiredPermission,filter.receiverList.pid,filter.receiverList.uid,-1,true);
    if (perm != PackageManager.PERMISSION_GRANTED) {
      Slog.w(TAG,"String_Node_Str" + r.intent.toString() + "String_Node_Str"+ filter.receiverList.app+ "String_Node_Str"+ filter.receiverList.pid+ "String_Node_Str"+ filter.receiverList.uid+ "String_Node_Str"+ "String_Node_Str"+ r.requiredPermission+ "String_Node_Str"+ r.callerPackage+ "String_Node_Str"+ r.callingUid+ "String_Node_Str");
      skip=true;
    }
  }
  if (r.appOp != AppOpsManager.OP_NONE) {
    int mode=mService.mAppOpsService.noteOperation(r.appOp,filter.receiverList.uid,filter.packageName);
    if (mode != AppOpsManager.MODE_ALLOWED) {
      if (DEBUG_BROADCAST)       Slog.v(TAG,"String_Node_Str" + r.appOp + "String_Node_Str"+ filter.receiverList.uid+ "String_Node_Str"+ filter.packageName);
      skip=true;
    }
  }
  if (!skip) {
    skip=!mService.mIntentFirewall.checkBroadcast(r.intent,r.callingUid,r.callingPid,r.resolvedType,filter.receiverList.uid);
  }
  if (filter.receiverList.app == null || filter.receiverList.app.crashing) {
    Slog.w(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r+ "String_Node_Str"+ filter.receiverList+ "String_Node_Str");
    skip=true;
  }
  if (!skip) {
    if (ordered) {
      r.receiver=filter.receiverList.receiver.asBinder();
      r.curFilter=filter;
      filter.receiverList.curBroadcast=r;
      r.state=BroadcastRecord.CALL_IN_RECEIVE;
      if (filter.receiverList.app != null) {
        r.curApp=filter.receiverList.app;
        filter.receiverList.app.curReceiver=r;
        mService.updateOomAdjLocked(r.curApp,true);
      }
    }
    try {
      if (DEBUG_BROADCAST_LIGHT) {
        int seq=r.intent.getIntExtra("String_Node_Str",-1);
        Slog.i(TAG,"String_Node_Str" + filter + "String_Node_Str"+ seq+ "String_Node_Str"+ r);
      }
      performReceiveLocked(filter.receiverList.app,filter.receiverList.receiver,new Intent(r.intent),r.resultCode,r.resultData,r.resultExtras,r.ordered,r.initialSticky,r.userId);
      if (ordered) {
        r.state=BroadcastRecord.CALL_DONE_RECEIVE;
      }
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str" + r.intent,e);
      if (ordered) {
        r.receiver=null;
        r.curFilter=null;
        filter.receiverList.curBroadcast=null;
        if (filter.receiverList.app != null) {
          filter.receiverList.app.curReceiver=null;
        }
      }
    }
  }
}