Esempio n. 1
0
        /* goodG2B() - use goodsource and badsink */
        private void GoodG2B()
        {
            StreamReader data;

            /* FIX: Open, but do not close the file in the source */
            data = File.OpenText(@"GoodSource_OpenText.txt");
            CWE675_Duplicate_Operations_on_Resource__OpenText_53b.GoodG2BSink(data);
        }
Esempio n. 2
0
        /* goodB2G() - use badsource and goodsink */
        private void GoodB2G()
        {
            StreamReader data;

            data = File.OpenText(@"BadSource_OpenText.txt");
            /* POTENTIAL FLAW: Close the file in the source */
            data.Close();
            CWE675_Duplicate_Operations_on_Resource__OpenText_53b.GoodB2GSink(data);
        }