func: void bad() wchar_t * data ; data = NULL; CWE122_Heap_Based_Buffer_Overflow__cpp_dest_wchar_t_cat_84_bad * badObject = new CWE122_Heap_Based_Buffer_Overflow__cpp_dest_wchar_t_cat_84_bad ( data ) ; CWE122_Heap_Based_Buffer_Overflow__cpp_dest_wchar_t_cat_84_bad::CWE122_Heap_Based_Buffer_Overflow__cpp_dest_wchar_t_cat_84_bad(wchar_t * dataCopy) data = dataCopy; data = new wchar_t [ 50 ]; data [ 0 ] = L '\0' delete badObject CWE122_Heap_Based_Buffer_Overflow__cpp_dest_wchar_t_cat_84_bad::~CWE122_Heap_Based_Buffer_Overflow__cpp_dest_wchar_t_cat_84_bad() wchar_t source [ 100 ] ; wmemset ( source , L 'C' , 100 - 1 source [ 100 - 1 ] = L '\0' wcscat ( data , source ); 