Exemple #1
0
        /* GoodG2B2() - use goodsource and badsink by reversing the blocks in the if in the sink function */
        private void GoodG2B2()
        {
            long data;

            GoodG2B2PublicStatic = true;
            data = CWE197_Numeric_Truncation_Error__long_connect_tcp_to_short_22b.GoodG2B2Source();
            {
                /* POTENTIAL FLAW: Convert data to a short, possibly causing a truncation error */
                IO.WriteLine((short)data);
            }
        }
Exemple #2
0
        public override void Bad()
        {
            long data;

            badPublicStatic = true;
            data            = CWE197_Numeric_Truncation_Error__long_connect_tcp_to_short_22b.BadSource();
            {
                /* POTENTIAL FLAW: Convert data to a short, possibly causing a truncation error */
                IO.WriteLine((short)data);
            }
        }