text: /* TEMPLATE GENERATED TESTCASE FILE
  Filename: CWE36_Absolute_Path_Traversal__char_connect_socket_open_81_goodG2B.cpp
  Label Definition File: CWE36_Absolute_Path_Traversal.label.xml
  Template File: sources-sink-81_goodG2B.tmpl.cpp
  */
  /*
   * @description
   * CWE: 36 Absolute Path Traversal
   * BadSource: connect_socket Read data using a connect socket (client side)
   * GoodSource: Full path and file name
   * Sinks: open
   *    BadSink : Open the file named in data using open()
   * Flow Variant: 81 Data flow: data passed in a parameter to an virtual method called via a reference
   *
   * */
  #ifndef OMITGOOD
  
  #include "std_testcase.h"
  #include "CWE36_Absolute_Path_Traversal__char_connect_socket_open_81.h"
  
  #ifdef _WIN32
  #define OPEN _open
  #define CLOSE _close
  #else
  #include <unistd.h>
  #define OPEN open
  #define CLOSE close
  #endif
  
  namespace CWE36_Absolute_Path_Traversal__char_connect_socket_open_81
  {
  
  void CWE36_Absolute_Path_Traversal__char_connect_socket_open_81_goodG2B::action(char * data) const
  {
      {
          int fileDesc;
          /* POTENTIAL FLAW: Possibly opening a file without validating the file name or path */
          fileDesc = OPEN(data, O_RDWR|O_CREAT, S_IREAD|S_IWRITE);
          if (fileDesc != -1)
          {
              CLOSE(fileDesc);
          }
      }
  }
  
  }
  #endif /* OMITGOOD */
  