/* goodB2G() - use badsource and goodsink */ public static void GoodB2GSink(CWE690_NULL_Deref_From_Return__getParameter_Web_equals_67a.Container dataContainer, HttpRequest req, HttpResponse resp) { string data = dataContainer.containerOne; /* FIX: call equals() on string literal (that is not null) */ if ("CWE690".Equals(data)) { IO.WriteLine("data is CWE690"); } }
/* goodG2B() - use goodsource and badsink */ public static void GoodG2BSink(CWE690_NULL_Deref_From_Return__getParameter_Web_equals_67a.Container dataContainer, HttpRequest req, HttpResponse resp) { string data = dataContainer.containerOne; /* POTENTIAL FLAW: data could be null */ if (data.Equals("CWE690")) { IO.WriteLine("data is CWE690"); } }