Esempio n. 1
0
        /* goodB2G() - use badsource and goodsink */
        public static void GoodB2GSink(CWE690_NULL_Deref_From_Return__getParameter_Web_equals_67a.Container dataContainer, HttpRequest req, HttpResponse resp)
        {
            string data = dataContainer.containerOne;

            /* FIX: call equals() on string literal (that is not null) */
            if ("CWE690".Equals(data))
            {
                IO.WriteLine("data is CWE690");
            }
        }
Esempio n. 2
0
        /* goodG2B() - use goodsource and badsink */
        public static void GoodG2BSink(CWE690_NULL_Deref_From_Return__getParameter_Web_equals_67a.Container dataContainer, HttpRequest req, HttpResponse resp)
        {
            string data = dataContainer.containerOne;

            /* POTENTIAL FLAW: data could be null */
            if (data.Equals("CWE690"))
            {
                IO.WriteLine("data is CWE690");
            }
        }