/* 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); } long[] dataArray = new long[5]; dataArray[2] = data; CWE190_Integer_Overflow__Long_console_readLine_add_66b.GoodB2GSink(dataArray); }