@@ -14,63 +14,63 @@ static void sink(Object o) { }
1414
1515 class Test1 implements HttpRequestHandler {
1616 public void handle (ClassicHttpRequest req , ClassicHttpResponse res , HttpContext ctx ) throws IOException , ParseException {
17- B .sink (req .getAuthority ().getHostName ()); //$ hasTaintFlow
18- B .sink (req .getAuthority ().toString ()); //$ hasTaintFlow
19- B .sink (req .getMethod ()); //$ hasTaintFlow
20- B .sink (req .getPath ()); //$ hasTaintFlow
21- B .sink (req .getScheme ());
22- B .sink (req .getRequestUri ()); //$ hasTaintFlow
17+ B .sink (req .getAuthority ().getHostName ()); // $ hasTaintFlow
18+ B .sink (req .getAuthority ().toString ()); // $ hasTaintFlow
19+ B .sink (req .getMethod ()); // $ hasTaintFlow
20+ B .sink (req .getPath ()); // $ hasTaintFlow
21+ B .sink (req .getScheme ());
22+ B .sink (req .getRequestUri ()); // $ hasTaintFlow
2323 RequestLine line = new RequestLine (req );
24- B .sink (line .getUri ()); //$ hasTaintFlow
25- B .sink (line .getMethod ()); //$ hasTaintFlow
26- B .sink (req .getHeaders ()); //$ hasTaintFlow
27- B .sink (req .headerIterator ()); //$ hasTaintFlow
24+ B .sink (line .getUri ()); // $ hasTaintFlow
25+ B .sink (line .getMethod ()); // $ hasTaintFlow
26+ B .sink (req .getHeaders ()); // $ hasTaintFlow
27+ B .sink (req .headerIterator ()); // $ hasTaintFlow
2828 Header h = req .getHeaders ("abc" )[3 ];
29- B .sink (h .getName ()); //$ hasTaintFlow
30- B .sink (h .getValue ()); //$ hasTaintFlow
31- B .sink (req .getFirstHeader ("abc" )); //$ hasTaintFlow
32- B .sink (req .getLastHeader ("abc" )); //$ hasTaintFlow
29+ B .sink (h .getName ()); // $ hasTaintFlow
30+ B .sink (h .getValue ()); // $ hasTaintFlow
31+ B .sink (req .getFirstHeader ("abc" )); // $ hasTaintFlow
32+ B .sink (req .getLastHeader ("abc" )); // $ hasTaintFlow
3333 HttpEntity ent = req .getEntity ();
34- B .sink (ent .getContent ()); //$ hasTaintFlow
35- B .sink (ent .getContentEncoding ()); //$ hasTaintFlow
36- B .sink (ent .getContentType ()); //$ hasTaintFlow
37- B .sink (ent .getTrailerNames ()); //$ hasTaintFlow
38- B .sink (ent .getTrailers ().get ()); //$ hasTaintFlow
39- B .sink (EntityUtils .toString (ent )); //$ hasTaintFlow
40- B .sink (EntityUtils .toByteArray (ent )); //$ hasTaintFlow
41- B .sink (EntityUtils .parse (ent )); //$ hasTaintFlow
42- res .setEntity (new StringEntity ("<a href='" + req .getRequestUri () + "'>a</a>" )); //$ hasTaintFlow
43- res .setEntity (new ByteArrayEntity (EntityUtils .toByteArray (ent ), ContentType .TEXT_HTML )); //$ hasTaintFlow
44- res .setEntity (HttpEntities .create ("<a href='" + req .getRequestUri () + "'>a</a>" )); //$ hasTaintFlow
45- res .setHeader ("Location" , req .getRequestUri ()); //$ hasTaintFlow
46- res .setHeader (new BasicHeader ("Location" , req .getRequestUri ())); //$ hasTaintFlow
34+ B .sink (ent .getContent ()); // $ hasTaintFlow
35+ B .sink (ent .getContentEncoding ()); // $ hasTaintFlow
36+ B .sink (ent .getContentType ()); // $ hasTaintFlow
37+ B .sink (ent .getTrailerNames ()); // $ hasTaintFlow
38+ B .sink (ent .getTrailers ().get ()); // $ hasTaintFlow
39+ B .sink (EntityUtils .toString (ent )); // $ hasTaintFlow
40+ B .sink (EntityUtils .toByteArray (ent )); // $ hasTaintFlow
41+ B .sink (EntityUtils .parse (ent )); // $ hasTaintFlow
42+ res .setEntity (new StringEntity ("<a href='" + req .getRequestUri () + "'>a</a>" )); // $ hasTaintFlow
43+ res .setEntity (new ByteArrayEntity (EntityUtils .toByteArray (ent ), ContentType .TEXT_HTML )); // $ hasTaintFlow
44+ res .setEntity (HttpEntities .create ("<a href='" + req .getRequestUri () + "'>a</a>" )); // $ hasTaintFlow
45+ res .setHeader ("Location" , req .getRequestUri ()); // $ hasTaintFlow
46+ res .setHeader (new BasicHeader ("Location" , req .getRequestUri ())); // $ hasTaintFlow
4747 }
4848 }
4949
5050 void test2 () {
5151 ByteArrayBuffer bbuf = new ByteArrayBuffer (42 );
52- bbuf .append ((byte []) taint (), 0 , 3 );
53- sink (bbuf .array ()); //$ hasTaintFlow
54- sink (bbuf .toByteArray ()); //$ hasTaintFlow
55- sink (bbuf .toString ());
52+ bbuf .append ((byte []) taint (), 0 , 3 );
53+ sink (bbuf .array ()); // $ hasTaintFlow
54+ sink (bbuf .toByteArray ()); // $ hasTaintFlow
55+ sink (bbuf .toString ());
5656
5757 CharArrayBuffer cbuf = new CharArrayBuffer (42 );
58- cbuf .append (bbuf .toByteArray (), 0 , 3 );
59- sink (cbuf .toCharArray ()); //$ hasTaintFlow
60- sink (cbuf .toString ()); //$ hasTaintFlow
61- sink (cbuf .subSequence (0 , 3 )); //$ hasTaintFlow
62- sink (cbuf .substring (0 , 3 )); //$ hasTaintFlow
63- sink (cbuf .substringTrimmed (0 , 3 )); //$ hasTaintFlow
58+ cbuf .append (bbuf .toByteArray (), 0 , 3 );
59+ sink (cbuf .toCharArray ()); // $ hasTaintFlow
60+ sink (cbuf .toString ()); // $ hasTaintFlow
61+ sink (cbuf .subSequence (0 , 3 )); // $ hasTaintFlow
62+ sink (cbuf .substring (0 , 3 )); // $ hasTaintFlow
63+ sink (cbuf .substringTrimmed (0 , 3 )); // $ hasTaintFlow
6464
65- sink (Args .notNull (taint (), "x" )); //$ hasTaintFlow
66- sink (Args .notEmpty ((String ) taint (), "x" )); //$ hasTaintFlow
67- sink (Args .notBlank ((String ) taint (), "x" )); //$ hasTaintFlow
68- sink (Args .notNull ("x" , (String ) taint ()));
65+ sink (Args .notNull (taint (), "x" )); // $ hasTaintFlow
66+ sink (Args .notEmpty ((String ) taint (), "x" )); // $ hasTaintFlow
67+ sink (Args .notBlank ((String ) taint (), "x" )); // $ hasTaintFlow
68+ sink (Args .notNull ("x" , (String ) taint ()));
6969 }
7070
7171 class Test3 implements HttpServerRequestHandler {
7272 public void handle (ClassicHttpRequest req , HttpServerRequestHandler .ResponseTrigger restr , HttpContext ctx ) throws HttpException , IOException {
73- B .sink (req .getEntity ()); //$ hasTaintFlow
73+ B .sink (req .getEntity ()); // $ hasTaintFlow
7474 }
7575 }
76- }
76+ }
0 commit comments