text: /* TEMPLATE GENERATED TESTCASE FILE
  Filename: CWE134_Uncontrolled_Format_String__char_file_vfprintf_82_goodB2G.cpp
  Label Definition File: CWE134_Uncontrolled_Format_String.vasinks.label.xml
  Template File: sources-vasinks-82_goodB2G.tmpl.cpp
  */
  /*
   * @description
   * CWE: 134 Uncontrolled Format String
   * BadSource: file Read input from a file
   * GoodSource: Copy a fixed string into data
   * Sinks: vfprintf
   *    GoodSink: vfprintf with a format string
   *    BadSink : vfprintf without a format string
   * Flow Variant: 82 Data flow: data passed in a parameter to an virtual method called via a pointer
   *
   * */
  #ifndef OMITGOOD
  
  #include <stdarg.h>
  #include "std_testcase.h"
  #include "CWE134_Uncontrolled_Format_String__char_file_vfprintf_82.h"
  
  namespace CWE134_Uncontrolled_Format_String__char_file_vfprintf_82
  {
  
  static void goodB2GVaSink(char * data, ...)
  {
      {
          va_list args;
          va_start(args, data);
          /* FIX: Specify the format disallowing a format string vulnerability */
          vfprintf(stdout, "%s", args);
          va_end(args);
      }
  }
  
  void CWE134_Uncontrolled_Format_String__char_file_vfprintf_82_goodB2G::action(char * data)
  {
      goodB2GVaSink(data, data);
  }
  
  }
  #endif /* OMITGOOD */
  