/* goodB2G() - use badsource and goodsink */ public static void GoodB2GSink(CWE476_NULL_Pointer_Dereference__int_array_67a.Container dataContainer) { int[] data = dataContainer.containerOne; /* FIX: validate that data is non-null */ if (data != null) { IO.WriteLine("" + data.Length); } else { IO.WriteLine("data is null"); } }
/* goodG2B() - use goodsource and badsink */ public static void GoodG2BSink(CWE476_NULL_Pointer_Dereference__int_array_67a.Container dataContainer) { int[] data = dataContainer.containerOne; /* POTENTIAL FLAW: null dereference will occur if data is null */ IO.WriteLine("" + data.Length); }