func: static void goodG2B() char * data ; data = new char [ 100 ]; CWE122_Heap_Based_Buffer_Overflow__cpp_CWE806_char_snprintf_84_goodG2B * goodG2BObject = new CWE122_Heap_Based_Buffer_Overflow__cpp_CWE806_char_snprintf_84_goodG2B ( data ) ; CWE122_Heap_Based_Buffer_Overflow__cpp_CWE806_char_snprintf_84_goodG2B::CWE122_Heap_Based_Buffer_Overflow__cpp_CWE806_char_snprintf_84_goodG2B(char * dataCopy) data = dataCopy; memset ( data , 'A' , 50 - 1 ); data [ 50 - 1 ] = '\0'; delete goodG2BObject CWE122_Heap_Based_Buffer_Overflow__cpp_CWE806_char_snprintf_84_goodG2B::~CWE122_Heap_Based_Buffer_Overflow__cpp_CWE806_char_snprintf_84_goodG2B() char dest [ 50 ] = "" ; SNPRINTF ( dest , strlen ( data ) , "%s" , data ); 