@@ -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=y
18- B .sink (req .getAuthority ().toString ()); //$hasTaintFlow=y
19- B .sink (req .getMethod ()); //$hasTaintFlow=y
20- B .sink (req .getPath ()); //$hasTaintFlow=y
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
2121 B .sink (req .getScheme ());
22- B .sink (req .getRequestUri ()); //$hasTaintFlow=y
22+ B .sink (req .getRequestUri ()); //$hasTaintFlow
2323 RequestLine line = new RequestLine (req );
24- B .sink (line .getUri ()); //$hasTaintFlow=y
25- B .sink (line .getMethod ()); //$hasTaintFlow=y
26- B .sink (req .getHeaders ()); //$hasTaintFlow=y
27- B .sink (req .headerIterator ()); //$hasTaintFlow=y
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=y
30- B .sink (h .getValue ()); //$hasTaintFlow=y
31- B .sink (req .getFirstHeader ("abc" )); //$hasTaintFlow=y
32- B .sink (req .getLastHeader ("abc" )); //$hasTaintFlow=y
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=y
35- B .sink (ent .getContentEncoding ()); //$hasTaintFlow=y
36- B .sink (ent .getContentType ()); //$hasTaintFlow=y
37- B .sink (ent .getTrailerNames ()); //$hasTaintFlow=y
38- B .sink (ent .getTrailers ().get ()); //$hasTaintFlow=y
39- B .sink (EntityUtils .toString (ent )); //$hasTaintFlow=y
40- B .sink (EntityUtils .toByteArray (ent )); //$hasTaintFlow=y
41- B .sink (EntityUtils .parse (ent )); //$hasTaintFlow=y
42- res .setEntity (new StringEntity ("<a href='" + req .getRequestUri () + "'>a</a>" )); //$hasTaintFlow=y
43- res .setEntity (new ByteArrayEntity (EntityUtils .toByteArray (ent ), ContentType .TEXT_HTML )); //$hasTaintFlow=y
44- res .setEntity (HttpEntities .create ("<a href='" + req .getRequestUri () + "'>a</a>" )); //$hasTaintFlow=y
45- res .setHeader ("Location" , req .getRequestUri ()); //$hasTaintFlow=y
46- res .setHeader (new BasicHeader ("Location" , req .getRequestUri ())); //$hasTaintFlow=y
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 );
5252 bbuf .append ((byte []) taint (), 0 , 3 );
53- sink (bbuf .array ()); //$hasTaintFlow=y
54- sink (bbuf .toByteArray ()); //$hasTaintFlow=y
53+ sink (bbuf .array ()); //$hasTaintFlow
54+ sink (bbuf .toByteArray ()); //$hasTaintFlow
5555 sink (bbuf .toString ());
5656
5757 CharArrayBuffer cbuf = new CharArrayBuffer (42 );
5858 cbuf .append (bbuf .toByteArray (), 0 , 3 );
59- sink (cbuf .toCharArray ()); //$hasTaintFlow=y
60- sink (cbuf .toString ()); //$hasTaintFlow=y
61- sink (cbuf .subSequence (0 , 3 )); //$hasTaintFlow=y
62- sink (cbuf .substring (0 , 3 )); //$hasTaintFlow=y
63- sink (cbuf .substringTrimmed (0 , 3 )); //$hasTaintFlow=y
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=y
66- sink (Args .notEmpty ((String ) taint (), "x" )); //$hasTaintFlow=y
67- sink (Args .notBlank ((String ) taint (), "x" )); //$hasTaintFlow=y
65+ sink (Args .notNull (taint (), "x" )); //$hasTaintFlow
66+ sink (Args .notEmpty ((String ) taint (), "x" )); //$hasTaintFlow
67+ sink (Args .notBlank ((String ) taint (), "x" )); //$hasTaintFlow
6868 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=y
73+ B .sink (req .getEntity ()); //$hasTaintFlow
7474 }
7575 }
7676}
0 commit comments