/* goodB2G2() - use badsource and goodsink by reversing the blocks in the if in the sink function */ private void GoodB2G2() { uint data = 0u; /* POTENTIAL FLAW: Use the minimum size of the data type */ data = uint.MinValue; goodB2G2PublicStatic = true; CWE191_Integer_Underflow__UInt32_min_multiply_22b.GoodB2G2Sink(data); }
/* goodG2B() - use goodsource and badsink */ private void GoodG2B() { uint data = 0u; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; goodG2BPublicStatic = true; CWE191_Integer_Underflow__UInt32_min_multiply_22b.GoodG2BSink(data); }
public override void Bad() { uint data = 0u; /* POTENTIAL FLAW: Use the minimum size of the data type */ data = uint.MinValue; badPublicStatic = true; CWE191_Integer_Underflow__UInt32_min_multiply_22b.BadSink(data); }