func: static void goodG2B() int * data ; data = NULL; data = ( int * ) malloc ( 10 * sizeof ( int ) ); CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_82_base * baseObject = new CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_82_goodG2B baseObject -> action ( data ); void CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_82_goodG2B::action(int * data) int source [ 10 ] = { 0 } ; size_t i ; for (i = 0; i < 10; i++) data [ i ] = source [ i ]; free ( data ); 