/* goodG2B() - use goodsource and badsink */ private static void GoodG2B(HttpRequest req, HttpResponse resp) { string data = CWE690_NULL_Deref_From_Return__getParameter_Web_equals_61b.GoodG2BSource(req, resp); /* POTENTIAL FLAW: data could be null */ if (data.Equals("CWE690")) { IO.WriteLine("data is CWE690"); } }
/* goodB2G() - use badsource and goodsink */ private static void GoodB2G(HttpRequest req, HttpResponse resp) { string data = CWE690_NULL_Deref_From_Return__getParameter_Web_equals_61b.GoodB2GSource(req, resp); /* FIX: call equals() on string literal (that is not null) */ if ("CWE690".Equals(data)) { IO.WriteLine("data is CWE690"); } }
public override void Bad(HttpRequest req, HttpResponse resp) { string data = CWE690_NULL_Deref_From_Return__getParameter_Web_equals_61b.BadSource(req, resp); /* POTENTIAL FLAW: data could be null */ if (data.Equals("CWE690")) { IO.WriteLine("data is CWE690"); } }