/* goodG2B() - use goodsource and badsink */ public static void GoodG2BSink(CWE675_Duplicate_Operations_on_Resource__OpenText_67a.Container dataContainer) { StreamReader data = dataContainer.containerOne; /* POTENTIAL FLAW: Close the file in the sink (it may have been closed in the Source) */ data.Close(); }
/* goodB2G() - use badsource and goodsink */ public static void GoodB2GSink(CWE675_Duplicate_Operations_on_Resource__OpenText_67a.Container dataContainer) { StreamReader data = dataContainer.containerOne; /* Do nothing */ /* FIX: Don't close the file in the sink */ ; /* empty statement needed for some flow variants */ }