/* goodB2G() - use BadSource and GoodSink */ private void goodB2G() throws Throwable { int data; /* POTENTIAL FLAW: Set data to a value greater than the size of the array */ data = 100; CWE129_Improper_Validation_of_Array_Index__large_fixed_array_write_no_check_81_base baseObject = new CWE129_Improper_Validation_of_Array_Index__large_fixed_array_write_no_check_81_goodB2G(); baseObject.action(data); }
/* goodG2B() - use GoodSource and BadSink */ private void goodG2B() throws Throwable { int data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; CWE129_Improper_Validation_of_Array_Index__large_fixed_array_write_no_check_81_base baseObject = new CWE129_Improper_Validation_of_Array_Index__large_fixed_array_write_no_check_81_goodG2B(); baseObject.action(data); }