コード例 #1
0
 /* goodB2G() - use badsource and goodsink */
 private static void GoodB2G()
 {
     int[] data = CWE476_NULL_Pointer_Dereference__int_array_61b.GoodB2GSource();
     /* FIX: validate that data is non-null */
     if (data != null)
     {
         IO.WriteLine("" + data.Length);
     }
     else
     {
         IO.WriteLine("data is null");
     }
 }
コード例 #2
0
 /* goodG2B() - use goodsource and badsink */
 private static void GoodG2B()
 {
     int[] data = CWE476_NULL_Pointer_Dereference__int_array_61b.GoodG2BSource();
     /* POTENTIAL FLAW: null dereference will occur if data is null */
     IO.WriteLine("" + data.Length);
 }
コード例 #3
0
 public override void Bad()
 {
     int[] data = CWE476_NULL_Pointer_Dereference__int_array_61b.BadSource();
     /* POTENTIAL FLAW: null dereference will occur if data is null */
     IO.WriteLine("" + data.Length);
 }