/* goodG2B() - use goodsource and badsink */ private static void GoodG2B() { string data; /* FIX: Use a hardcoded string */ data = "foo"; Container dataContainer = new Container(); dataContainer.containerOne = data; CWE36_Absolute_Path_Traversal__Environment_67b.GoodG2BSink(dataContainer); }
public override void Bad() { string data; /* get environment variable ADD */ /* POTENTIAL FLAW: Read data from an environment variable */ data = Environment.GetEnvironmentVariable("ADD"); Container dataContainer = new Container(); dataContainer.containerOne = data; CWE36_Absolute_Path_Traversal__Environment_67b.BadSink(dataContainer); }