@@ -14,63 +14,63 @@ static void sink(Object o) { }
14
14
15
15
class Test1 implements HttpRequestHandler {
16
16
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
21
21
B .sink (req .getScheme ());
22
- B .sink (req .getRequestUri ()); //$hasTaintFlow=y
22
+ B .sink (req .getRequestUri ()); //$hasTaintFlow
23
23
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
28
28
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
33
33
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
47
47
}
48
48
}
49
49
50
50
void test2 () {
51
51
ByteArrayBuffer bbuf = new ByteArrayBuffer (42 );
52
52
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
55
55
sink (bbuf .toString ());
56
56
57
57
CharArrayBuffer cbuf = new CharArrayBuffer (42 );
58
58
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
64
64
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
68
68
sink (Args .notNull ("x" , (String ) taint ()));
69
69
}
70
70
71
71
class Test3 implements HttpServerRequestHandler {
72
72
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
74
74
}
75
75
}
76
76
}
0 commit comments