Program: 31370
Project: 31370
Buggy source:
/** 
 * Test of executeOSCommand method, of class org.owasp.esapi.Executor
 * @throws Exception the exception
 */
public void testExecuteWindowsSystemCommand() throws Exception {
  System.out.println("String_Node_Str");
  if (System.getProperty("String_Node_Str").indexOf("String_Node_Str") == -1) {
    System.out.println("String_Node_Str");
    return;
  }
  Codec codec=new WindowsCodec();
  System.out.println("String_Node_Str");
  Executor instance=ESAPI.executor();
  File executable=new File("String_Node_Str");
  List params=new ArrayList();
  try {
    params.add("String_Node_Str");
    params.add("String_Node_Str");
    String result=instance.executeSystemCommand(executable,new ArrayList(params));
    System.out.println("String_Node_Str" + result);
    assertTrue(result.length() > 0);
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail();
  }
  try {
    File exec2=new File(executable.getPath() + "String_Node_Str");
    String result=instance.executeSystemCommand(exec2,new ArrayList(params));
    System.out.println("String_Node_Str" + result);
    fail();
  }
 catch (  Exception e) {
  }
  try {
    File exec2=new File(executable.getPath() + "String_Node_Str");
    String result=instance.executeSystemCommand(exec2,new ArrayList(params));
    System.out.println("String_Node_Str" + result);
    fail();
  }
 catch (  Exception e) {
  }
  try {
    File workdir=new File("String_Node_Str");
    String result=instance.executeSystemCommand(executable,new ArrayList(params),workdir,codec,false);
    System.out.println("String_Node_Str" + result);
    fail();
  }
 catch (  Exception e) {
  }
  try {
    params.add("String_Node_Str");
    String result=instance.executeSystemCommand(executable,new ArrayList(params));
    System.out.println("String_Node_Str" + result);
  }
 catch (  Exception e) {
    fail();
  }
  try {
    params.set(params.size() - 1,"String_Node_Str");
    String result=instance.executeSystemCommand(executable,new ArrayList(params));
    System.out.println("String_Node_Str" + result);
  }
 catch (  Exception e) {
    fail();
  }
  try {
    params.set(params.size() - 1,"String_Node_Str");
    String result=instance.executeSystemCommand(executable,new ArrayList(params));
    System.out.println("String_Node_Str" + result);
  }
 catch (  Exception e) {
    fail();
  }
}

Fixed version (ground truth):
/** 
 * Test of executeOSCommand method, of class org.owasp.esapi.Executor
 * @throws Exception the exception
 */
public void testExecuteWindowsSystemCommand() throws Exception {
  System.out.println("String_Node_Str");
  if (System.getProperty("String_Node_Str").indexOf("String_Node_Str") == -1) {
    System.out.println("String_Node_Str");
    return;
  }
  File tmpDir=new File(System.getProperty("String_Node_Str")).getCanonicalFile();
  File sysRoot=new File(System.getenv("String_Node_Str")).getCanonicalFile();
  File sys32=new File(sysRoot,"String_Node_Str").getCanonicalFile();
  File cmd=new File(sys32,"String_Node_Str").getCanonicalFile();
  ESAPI.setSecurityConfiguration(new Conf(ESAPI.securityConfiguration(),Collections.singletonList(cmd.getPath()),tmpDir));
  Codec codec=new WindowsCodec();
  System.out.println("String_Node_Str");
  Executor instance=ESAPI.executor();
  List params=new ArrayList();
  try {
    params.add("String_Node_Str");
    params.add("String_Node_Str");
    String result=instance.executeSystemCommand(cmd,new ArrayList(params));
    System.out.println("String_Node_Str" + result);
    assertTrue(result.length() > 0);
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail();
  }
  try {
    File exec2=new File(cmd.getPath() + "String_Node_Str");
    String result=instance.executeSystemCommand(exec2,new ArrayList(params));
    System.out.println("String_Node_Str" + result);
    fail();
  }
 catch (  Exception e) {
  }
  try {
    File exec2=new File(cmd.getPath() + "String_Node_Str");
    String result=instance.executeSystemCommand(exec2,new ArrayList(params));
    System.out.println("String_Node_Str" + result);
    fail();
  }
 catch (  Exception e) {
  }
  try {
    File workdir=new File("String_Node_Str");
    String result=instance.executeSystemCommand(cmd,new ArrayList(params),workdir,codec,false);
    System.out.println("String_Node_Str" + result);
    fail();
  }
 catch (  Exception e) {
  }
  try {
    params.add("String_Node_Str");
    String result=instance.executeSystemCommand(cmd,new ArrayList(params));
    System.out.println("String_Node_Str" + result);
  }
 catch (  Exception e) {
    fail();
  }
  try {
    params.set(params.size() - 1,"String_Node_Str");
    String result=instance.executeSystemCommand(cmd,new ArrayList(params));
    System.out.println("String_Node_Str" + result);
  }
 catch (  Exception e) {
    fail();
  }
  try {
    params.set(params.size() - 1,"String_Node_Str");
    String result=instance.executeSystemCommand(cmd,new ArrayList(params));
    System.out.println("String_Node_Str" + result);
  }
 catch (  Exception e) {
    fail();
  }
}