Пример #1
0
        /* goodG2B() - use goodsource and badsink */
        private void GoodG2B()
        {
            string data;

            /* FIX: Use a hardcoded string */
            data = "foo";
            CWE78_OS_Command_Injection__ReadLine_52b.GoodG2BSink(data);
        }
Пример #2
0
        public override void Bad()
        {
            string data;

            data = ""; /* Initialize data */
            {
                /* read user input from console with ReadLine */
                try
                {
                    /* POTENTIAL FLAW: Read data from the console using ReadLine */
                    data = Console.ReadLine();
                }
                catch (IOException exceptIO)
                {
                    IO.Logger.Log(NLog.LogLevel.Warn, exceptIO, "Error with stream reading");
                }
            }
            CWE78_OS_Command_Injection__ReadLine_52b.BadSink(data);
        }