Program: 2776
Project: 2776
Buggy source:
/** 
 * Retrieve a PendingIntent that will start a service, like calling  {@link Context#startService Context.startService()}.  The start arguments given to the service will come from the extras of the Intent.
 * @param context The Context in which this PendingIntent should startthe service.
 * @param requestCode Private request code for the sender (currentlynot used).
 * @param intent An Intent describing the service to be started.
 * @param flags May be {@link #FLAG_ONE_SHOT},   {@link #FLAG_NO_CREATE},  {@link #FLAG_CANCEL_CURRENT},   {@link #FLAG_UPDATE_CURRENT}, or any of the flags as supported by  {@link Intent#fillIn Intent.fillIn()} to control which unspecified partsof the intent that can be supplied when the actual send happens.
 * @return Returns an existing or new PendingIntent matching the givenparameters.  May return null only if  {@link #FLAG_NO_CREATE} has beensupplied.
 */
public static PendingIntent getService(Context context,int requestCode,Intent intent,int flags){
  String packageName=context.getPackageName();
  String resolvedType=intent != null ? intent.resolveTypeIfNeeded(context.getContentResolver()) : null;
  try {
    intent.setAllowFds(false);
    IIntentSender target=ActivityManagerNative.getDefault().getIntentSender(ActivityManager.INTENT_SENDER_SERVICE,packageName,null,null,requestCode,new Intent[]{intent},resolvedType != null ? new String[]{resolvedType} : null,flags,null,UserHandle.myUserId());
    return target != null ? new PendingIntent(target) : null;
  }
 catch (  RemoteException e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieve a PendingIntent that will start a service, like calling  {@link Context#startService Context.startService()}.  The start arguments given to the service will come from the extras of the Intent. <p class="note">For security reasons, the   {@link android.content.Intent}you supply here should almost always be an <em>explicit intent</em>, that is specify an explicit component to be delivered to through  {@link Intent#setClass(android.content.Context,Class)} Intent.setClass</p>
 * @param context The Context in which this PendingIntent should startthe service.
 * @param requestCode Private request code for the sender (currentlynot used).
 * @param intent An Intent describing the service to be started.
 * @param flags May be {@link #FLAG_ONE_SHOT},   {@link #FLAG_NO_CREATE},  {@link #FLAG_CANCEL_CURRENT},   {@link #FLAG_UPDATE_CURRENT}, or any of the flags as supported by  {@link Intent#fillIn Intent.fillIn()} to control which unspecified partsof the intent that can be supplied when the actual send happens.
 * @return Returns an existing or new PendingIntent matching the givenparameters.  May return null only if  {@link #FLAG_NO_CREATE} has beensupplied.
 */
public static PendingIntent getService(Context context,int requestCode,Intent intent,int flags){
  String packageName=context.getPackageName();
  String resolvedType=intent != null ? intent.resolveTypeIfNeeded(context.getContentResolver()) : null;
  try {
    intent.setAllowFds(false);
    IIntentSender target=ActivityManagerNative.getDefault().getIntentSender(ActivityManager.INTENT_SENDER_SERVICE,packageName,null,null,requestCode,new Intent[]{intent},resolvedType != null ? new String[]{resolvedType} : null,flags,null,UserHandle.myUserId());
    return target != null ? new PendingIntent(target) : null;
  }
 catch (  RemoteException e) {
  }
  return null;
}