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