public override void Bad() { string data; /* FLAW: Set data to a hardcoded value */ data = "23 ~j;asn!@#/>as"; CWE321_Hard_Coded_Cryptographic_Key__basic_53b.BadSink(data); }
/* goodG2B() - use goodsource and badsink */ private void GoodG2B() { string data; data = ""; /* Initialize data */ /* read user input from console with readLine */ try { /* FIX: Read data from the console using readLine() */ data = Console.ReadLine(); } catch (IOException exceptIO) { IO.Logger.Log(NLog.LogLevel.Warn, "Error with stream reading", exceptIO); } CWE321_Hard_Coded_Cryptographic_Key__basic_53b.GoodG2BSink(data); }