Example #1
0
        /* goodG2B() - use goodsource and badsink */
        private static void GoodG2B()
        {
            byte data = CWE190_Integer_Overflow__Byte_max_square_61b.GoodG2BSource();
            /* POTENTIAL FLAW: if (data*data) > byte.MaxValue, this will overflow */
            byte result = (byte)(data * data);

            IO.WriteLine("result: " + result);
        }