text: /* TEMPLATE GENERATED TESTCASE FILE
  Filename: CWE127_Buffer_Underread__new_wchar_t_memmove_53b.cpp
  Label Definition File: CWE127_Buffer_Underread__new.label.xml
  Template File: sources-sink-53b.tmpl.cpp
  */
  /*
   * @description
   * CWE: 127 Buffer Under-read
   * BadSource:  Set data pointer to before the allocated memory buffer
   * GoodSource: Set data pointer to the allocated memory buffer
   * Sink: memmove
   *    BadSink : Copy data to string using memmove
   * Flow Variant: 53 Data flow: data passed as an argument from one function through two others to a fourth; all four functions are in different source files
   *
   * */
  
  #include "std_testcase.h"
  
  #include <wchar.h>
  
  namespace CWE127_Buffer_Underread__new_wchar_t_memmove_53
  {
  
  /* all the sinks are the same, we just want to know where the hit originated if a tool flags one */
  
  #ifndef OMITBAD
  
  /* bad function declaration */
  void badSink_c(wchar_t * data);
  
  void badSink_b(wchar_t * data)
  {
      badSink_c(data);
  }
  
  #endif /* OMITBAD */
  
  #ifndef OMITGOOD
  
  /* goodG2B uses the GoodSource with the BadSink */
  void goodG2BSink_c(wchar_t * data);
  
  void goodG2BSink_b(wchar_t * data)
  {
      goodG2BSink_c(data);
  }
  
  #endif /* OMITGOOD */
  
  } /* close namespace */
  