/* goodG2B() - use goodsource and badsink */ private static void GoodG2B() { int data = CWE789_Uncontrolled_Mem_Alloc__NetClient_ArrayList_61b.GoodG2BSource(); /* POTENTIAL FLAW: Create an ArrayList using data as the initial size. data may be very large, creating memory issues */ ArrayList intArrayList = new ArrayList(data); }
public override void Bad() { int data = CWE789_Uncontrolled_Mem_Alloc__NetClient_ArrayList_61b.BadSource(); /* POTENTIAL FLAW: Create an ArrayList using data as the initial size. data may be very large, creating memory issues */ ArrayList intArrayList = new ArrayList(data); }