/* goodG2B() - use goodsource and badsink */ private static void GoodG2B() { double data = CWE197_Numeric_Truncation_Error__double_large_to_int_61b.GoodG2BSource(); { /* POTENTIAL FLAW: Convert data to a int, possibly causing a truncation error */ IO.WriteLine((int)data); } }
public override void Bad() { double data = CWE197_Numeric_Truncation_Error__double_large_to_int_61b.BadSource(); { /* POTENTIAL FLAW: Convert data to a int, possibly causing a truncation error */ IO.WriteLine((int)data); } }