func: void bad() int data ; data = - 1; CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_84_bad * badObject = new CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_84_bad ( data ) ; CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_84_bad::CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_84_bad(int dataCopy) data = dataCopy; fscanf ( stdin , "%d" , & data ); delete badObject CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_84_bad::~CWE122_Heap_Based_Buffer_Overflow__c_CWE129_fscanf_84_bad() int * buffer = ( int * ) malloc ( 10 * sizeof ( int ) ) ; buffer [ i ] = 0; buffer [ data ] = 1; for(i = 0; i < 10; i++) printIntLine ( buffer [ i ] ); void printIntLine (int intNumber) printf ( "%d\n" , intNumber ); free ( buffer ); 