Esempio n. 1
0
        /* goodB2G() - use badsource and goodsink */
        private static void GoodB2G()
        {
            int data = CWE191_Integer_Underflow__int_min_sub_61b.GoodB2GSource();

            /* FIX: Add a check to prevent an overflow from occurring */
            if (data > int.MinValue)
            {
                int result = (int)(data - 1);
                IO.WriteLine("result: " + result);
            }
            else
            {
                IO.WriteLine("data value is too small to perform subtraction.");
            }
        }