/* goodB2G() - use BadSource and GoodSink */ private static void GoodB2G() { long data; /* init data */ data = 0; /* POTENTIAL FLAW: Read data from console with ReadLine*/ try { string stringNumber = Console.ReadLine(); if (stringNumber != null) { data = long.Parse(stringNumber.Trim()); } } catch (IOException exceptIO) { IO.Logger.Log(NLog.LogLevel.Warn, "Error with stream reading", exceptIO); } catch (FormatException exceptNumberFormat) { IO.Logger.Log(NLog.LogLevel.Warn, "Error with number parsing", exceptNumberFormat); } Dictionary <int, long> dataDictionary = new Dictionary <int, long>(); dataDictionary.Add(0, data); dataDictionary.Add(1, data); dataDictionary.Add(2, data); CWE191_Integer_Underflow__Long_console_ReadLine_multiply_74b.GoodB2GSink(dataDictionary); }