/* goodG2B() - use goodsource and badsink */ private static void GoodG2B() { string data; /* FIX: Use a hardcoded string */ data = "foo"; CWE134_Externally_Controlled_Format_String__Environment_Format_71b.GoodG2BSink((Object)data); }
/* goodB2G() - use badsource and goodsink */ private static void GoodB2G() { string data; /* get environment variable ADD */ /* POTENTIAL FLAW: Read data from an environment variable */ data = Environment.GetEnvironmentVariable("ADD"); CWE134_Externally_Controlled_Format_String__Environment_Format_71b.GoodB2GSink((Object)data); }
public override void Bad() { string data; /* get environment variable ADD */ /* POTENTIAL FLAW: Read data from an environment variable */ data = Environment.GetEnvironmentVariable("ADD"); CWE134_Externally_Controlled_Format_String__Environment_Format_71b.BadSink((Object)data); }