Example #1
0
        /* goodG2B() - use goodsource and badsink */
        public static void GoodG2BSink(CWE476_NULL_Pointer_Dereference__String_67a.Container dataContainer)
        {
            string data = dataContainer.containerOne;

            /* POTENTIAL FLAW: null dereference will occur if data is null */
            IO.WriteLine("" + data.Length);
        }
Example #2
0
        /* goodB2G() - use badsource and goodsink */
        public static void GoodB2GSink(CWE476_NULL_Pointer_Dereference__String_67a.Container dataContainer)
        {
            string data = dataContainer.containerOne;

            /* FIX: validate that data is non-null */
            if (data != null)
            {
                IO.WriteLine("" + data.Length);
            }
            else
            {
                IO.WriteLine("data is null");
            }
        }