text: /* TEMPLATE GENERATED TESTCASE FILE
  Filename: CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_81_bad.cpp
  Label Definition File: CWE121_Stack_Based_Buffer_Overflow__src.label.xml
  Template File: sources-sink-81_bad.tmpl.cpp
  */
  /*
   * @description
   * CWE: 121 Stack Based Buffer Overflow
   * BadSource:  Initialize data as a large string
   * GoodSource: Initialize data as a small string
   * Sinks: cpy
   *    BadSink : Copy data to string using strcpy
   * Flow Variant: 81 Data flow: data passed in a parameter to an virtual method called via a reference
   *
   * */
  #ifndef OMITBAD
  
  #include "std_testcase.h"
  #include "CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_81.h"
  
  namespace CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_81
  {
  
  void CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cpy_81_bad::action(char * data) const
  {
      {
          char dest[50] = "";
          /* POTENTIAL FLAW: Possible buffer overflow if data is larger than dest */
          strcpy(dest, data);
          printLine(data);
      }
  }
  
  }
  #endif /* OMITBAD */
  