Program: 54267
Project: 54267
Buggy source:
private void setStartedState(){
  mSearchProgress.setVisibility(View.VISIBLE);
  mRunning=true;
  mThread=new Thread(new Runnable(){
    @Override public void run(){
      boolean msf_only=System.getSettings().getBoolean("String_Node_Str",false);
      boolean found_something=false;
      for (      final Vulnerability vuln : System.getCurrentTarget().getVulnerabilities()) {
        if (!mRunning)         return;
        Exploit ex=null;
        results.clear();
        if (vuln.osvdb_id != 0) {
          if (vuln.has_msf_exploit)           ex=MSFDatabase.search_by_osvdb(vuln.osvdb_id);
          if (ex != null)           results.add(ex);
 else           if (!msf_only)           results.addAll(EXDatabase.search_by_osvdb(vuln.osvdb_id));
        }
        if (vuln.cve_id != null) {
          ex=MSFDatabase.search_by_cve(vuln.cve_id.substring(4));
          if (ex != null)           results.add(ex);
 else           if (!msf_only)           results.addAll(EXDatabase.search_by_cveid(vuln.cve_id.substring(4)));
        }
        if (!found_something && !results.isEmpty())         found_something=true;
        for (        final Exploit exp : results) {
          System.addExploit(vuln,exp);
          ExploitFinder.this.runOnUiThread(new Runnable(){
            @Override public void run(){
              mAdapter.add(exp);
            }
          }
);
        }
      }
      if (!found_something) {
        ExploitFinder.this.runOnUiThread(new Runnable(){
          @Override public void run(){
            new FinishDialog("String_Node_Str","String_Node_Str",ExploitFinder.this).show();
          }
        }
);
      }
      ExploitFinder.this.runOnUiThread(new Runnable(){
        @Override public void run(){
          setStoppedState();
        }
      }
);
    }
  }
);
  mThread.start();
}

Fixed version (ground truth):
private void setStartedState(){
  mSearchProgress.setVisibility(View.VISIBLE);
  mRunning=true;
  mThread=new Thread(new Runnable(){
    @Override public void run(){
      boolean msf_only=System.getSettings().getBoolean("String_Node_Str",false);
      boolean found_something=false;
      for (      final Vulnerability vuln : System.getCurrentTarget().getVulnerabilities()) {
        if (!mRunning)         return;
        Exploit ex=null;
        results.clear();
        if (vuln.osvdb_id != 0) {
          if (vuln.has_msf_exploit)           ex=MSFDatabase.search_by_osvdb(vuln.osvdb_id);
          if (ex != null) {
            results.add(ex);
          }
 else           if (!msf_only) {
            ArrayList<Exploit> exploits=EXDatabase.search_by_osvdb(vuln.osvdb_id);
            if (exploits != null)             results.addAll(exploits);
          }
        }
        if (vuln.cve_id != null) {
          ex=MSFDatabase.search_by_cve(vuln.cve_id.substring(4));
          if (ex != null)           results.add(ex);
 else           if (!msf_only)           results.addAll(EXDatabase.search_by_cveid(vuln.cve_id.substring(4)));
        }
        if (!found_something && !results.isEmpty())         found_something=true;
        for (        final Exploit exp : results) {
          System.addExploit(vuln,exp);
          ExploitFinder.this.runOnUiThread(new Runnable(){
            @Override public void run(){
              mAdapter.add(exp);
            }
          }
);
        }
      }
      if (!found_something) {
        ExploitFinder.this.runOnUiThread(new Runnable(){
          @Override public void run(){
            new FinishDialog("String_Node_Str","String_Node_Str",ExploitFinder.this).show();
          }
        }
);
      }
      ExploitFinder.this.runOnUiThread(new Runnable(){
        @Override public void run(){
          setStoppedState();
        }
      }
);
    }
  }
);
  mThread.start();
}