text: /* TEMPLATE GENERATED TESTCASE FILE
  Filename: CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memmove_82_goodG2B.cpp
  Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE193.label.xml
  Template File: sources-sink-82_goodG2B.tmpl.cpp
  */
  /*
   * @description
   * CWE: 121 Stack Based Buffer Overflow
   * BadSource:  Point data to a buffer that does not have space for a NULL terminator
   * GoodSource: Point data to a buffer that includes space for a NULL terminator
   * Sinks: memmove
   *    BadSink : Copy string to data using memmove()
   * Flow Variant: 82 Data flow: data passed in a parameter to an virtual method called via a pointer
   *
   * */
  #ifndef OMITGOOD
  
  #include "std_testcase.h"
  #include "CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memmove_82.h"
  
  namespace CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memmove_82
  {
  
  void CWE121_Stack_Based_Buffer_Overflow__CWE193_char_alloca_memmove_82_goodG2B::action(char * data)
  {
      {
          char source[10+1] = SRC_STRING;
          /* Copy length + 1 to include NUL terminator from source */
          /* POTENTIAL FLAW: data may not have enough space to hold source */
          memmove(data, source, (strlen(source) + 1) * sizeof(char));
          printLine(data);
      }
  }
  
  }
  #endif /* OMITGOOD */
  