/* goodG2B() - use goodsource and badsink */ private void GoodG2B(HttpRequest req, HttpResponse resp) { string data; /* FIX: Use a hardcoded string */ data = "foo"; CWE313_Cleartext_Storage_in_a_File_or_on_Disk__QueryString_Web_51b.GoodG2BSink(data, req, resp); }
/* goodB2G() - use badsource and goodsink */ private void GoodB2G(HttpRequest req, HttpResponse resp) { string data; 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"]; } } CWE313_Cleartext_Storage_in_a_File_or_on_Disk__QueryString_Web_51b.GoodB2GSink(data, req, resp); }