/* goodB2G() - use BadSource and GoodSink */ private void goodB2G() throws Throwable { long data; /* POTENTIAL FLAW: Initialize, but do not use data */ data = 5L; CWE563_Unused_Variable__unused_value_long_81_base baseObject = new CWE563_Unused_Variable__unused_value_long_81_goodB2G(); baseObject.action(data); }
/* goodG2B() - use GoodSource and BadSink */ private void goodG2B() throws Throwable { long data; /* FIX: Initialize and use data before it is overwritten */ data = 5L; IO.writeLine("" + data); CWE563_Unused_Variable__unused_value_long_81_base baseObject = new CWE563_Unused_Variable__unused_value_long_81_goodG2B(); baseObject.action(data); }