text: /* TEMPLATE GENERATED TESTCASE FILE
  Filename: CWE78_OS_Command_Injection__char_environment_w32_execv_82_bad.cpp
  Label Definition File: CWE78_OS_Command_Injection.strings.label.xml
  Template File: sources-sink-82_bad.tmpl.cpp
  */
  /*
   * @description
   * CWE: 78 OS Command Injection
   * BadSource: environment Read input from an environment variable
   * GoodSource: Fixed string
   * Sinks: w32_execv
   *    BadSink : execute command with execv
   * Flow Variant: 82 Data flow: data passed in a parameter to an virtual method called via a pointer
   *
   * */
  #ifndef OMITBAD
  
  #include "std_testcase.h"
  #include "CWE78_OS_Command_Injection__char_environment_w32_execv_82.h"
  
  #include <process.h>
  #define EXECV _execv
  
  namespace CWE78_OS_Command_Injection__char_environment_w32_execv_82
  {
  
  void CWE78_OS_Command_Injection__char_environment_w32_execv_82_bad::action(char * data)
  {
      {
          char *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL};
          /* execv - specify the path where the command is located */
          /* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
          EXECV(COMMAND_INT_PATH, args);
      }
  }
  
  }
  #endif /* OMITBAD */
  