/* goodB2G() - use badsource and goodsink */ private static void GoodB2G(HttpRequest req, HttpResponse resp) { data = ""; /* initialize data in case id is not in query string */ /* POTENTIAL FLAW: Parse id param out of the URL querystring (without using getParameter()) */ { if (req.QueryString["id"] != null) { data = req.QueryString["id"]; } } CWE94_Improper_Control_of_Generation_of_Code__QueryString_Web_68b.GoodB2GSink(req, resp); }
/* goodG2B() - use goodsource and badsink */ private static void GoodG2B(HttpRequest req, HttpResponse resp) { /* FIX: Set data to an integer represented as a string */ data = "10"; CWE94_Improper_Control_of_Generation_of_Code__QueryString_Web_68b.GoodG2BSink(req, resp); }