Program: 193206
Project: 193206
Buggy source:
VoiceInteractionServiceInfo findAvailInteractor(int userHandle,String packageName){
  List<ResolveInfo> available=mContext.getPackageManager().queryIntentServicesAsUser(new Intent(VoiceInteractionService.SERVICE_INTERFACE),0,userHandle);
  int numAvailable=available.size();
  if (numAvailable == 0) {
    Slog.w(TAG,"String_Node_Str" + userHandle);
    return null;
  }
 else {
    VoiceInteractionServiceInfo foundInfo=null;
    for (int i=0; i < numAvailable; i++) {
      ServiceInfo cur=available.get(i).serviceInfo;
      if ((cur.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
        ComponentName comp=new ComponentName(cur.packageName,cur.name);
        try {
          VoiceInteractionServiceInfo info=new VoiceInteractionServiceInfo(mContext.getPackageManager(),comp,userHandle);
          if (info.getParseError() == null) {
            if (packageName == null || info.getServiceInfo().packageName.equals(packageName)) {
              if (foundInfo == null) {
                foundInfo=info;
              }
 else {
                Slog.w(TAG,"String_Node_Str" + "String_Node_Str" + new ComponentName(foundInfo.getServiceInfo().packageName,foundInfo.getServiceInfo().name) + "String_Node_Str"+ new ComponentName(cur.packageName,cur.name));
              }
            }
          }
 else {
            Slog.w(TAG,"String_Node_Str" + comp + "String_Node_Str"+ info.getParseError());
          }
        }
 catch (        PackageManager.NameNotFoundException e) {
          Slog.w(TAG,"String_Node_Str" + comp);
        }
catch (        RemoteException e) {
        }
      }
    }
    return foundInfo;
  }
}

Fixed version (ground truth):
VoiceInteractionServiceInfo findAvailInteractor(int userHandle,String packageName){
  List<ResolveInfo> available=mContext.getPackageManager().queryIntentServicesAsUser(new Intent(VoiceInteractionService.SERVICE_INTERFACE),0,userHandle);
  int numAvailable=available.size();
  if (numAvailable == 0) {
    Slog.w(TAG,"String_Node_Str" + userHandle);
    return null;
  }
 else {
    VoiceInteractionServiceInfo foundInfo=null;
    for (int i=0; i < numAvailable; i++) {
      ServiceInfo cur=available.get(i).serviceInfo;
      if ((cur.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
        ComponentName comp=new ComponentName(cur.packageName,cur.name);
        try {
          VoiceInteractionServiceInfo info=new VoiceInteractionServiceInfo(mContext.getPackageManager(),comp,userHandle);
          if (info.getParseError() == null) {
            if (packageName == null || info.getServiceInfo().packageName.equals(packageName)) {
              if (foundInfo == null) {
                foundInfo=info;
              }
 else {
                Slog.w(TAG,"String_Node_Str" + "String_Node_Str" + new ComponentName(foundInfo.getServiceInfo().packageName,foundInfo.getServiceInfo().name) + "String_Node_Str"+ new ComponentName(cur.packageName,cur.name));
              }
            }
          }
 else {
            Slog.w(TAG,"String_Node_Str" + comp + "String_Node_Str"+ info.getParseError());
          }
        }
 catch (        PackageManager.NameNotFoundException e) {
          Slog.w(TAG,"String_Node_Str" + comp);
        }
      }
    }
    return foundInfo;
  }
}