func: static void goodG2B() int data ; data = - 1; CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_84_goodG2B * goodG2BObject = new CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_84_goodG2B ( data ) ; CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_84_goodG2B::CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_84_goodG2B(int dataCopy) data = dataCopy; data = 7; delete goodG2BObject CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_84_goodG2B::~CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fgets_84_goodG2B() int i ; int * buffer = ( int * ) malloc ( 10 * sizeof ( int ) ) ; for (i = 0; i < 10; i++) buffer [ i ] = 0; if ( data >= 0 )  buffer [ data ] = 1; free ( buffer ); 