func: static void goodG2B() wchar_t * data ; data = NULL; CWE124_Buffer_Underwrite__malloc_wchar_t_ncpy_84_goodG2B * goodG2BObject = new CWE124_Buffer_Underwrite__malloc_wchar_t_ncpy_84_goodG2B ( data ) ; CWE124_Buffer_Underwrite__malloc_wchar_t_ncpy_84_goodG2B::CWE124_Buffer_Underwrite__malloc_wchar_t_ncpy_84_goodG2B(wchar_t * dataCopy) data = dataCopy; wchar_t * dataBuffer = ( wchar_t * ) malloc ( 100 * sizeof ( wchar_t ) ) ; wmemset ( dataBuffer , L 'A' , 100 - 1 dataBuffer [ 100 - 1 ] = L '\0' data = dataBuffer; delete goodG2BObject CWE124_Buffer_Underwrite__malloc_wchar_t_ncpy_84_goodG2B::~CWE124_Buffer_Underwrite__malloc_wchar_t_ncpy_84_goodG2B() wchar_t source [ 100 ] ; wmemset ( source , L 'C' , 100 - 1 source [ 100 - 1 ] = L '\0' wcsncpy ( data , source , 100 - 1 ); printWLine ( data ); void printWLine (const wchar_t * line) if ( line != NULL )  wprintf ( L "%ls\n" , line ) 