File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
java/ql/test/library-tests/dataflow/taint Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -189,4 +189,32 @@ public StringWrapper(String s) {
189
189
public static boolean safe () {
190
190
return true ;
191
191
}
192
+
193
+ public static void extendedTests (){
194
+ String s = taint ()[0 ];
195
+
196
+ String replReceiver = s .replace ("irrelevant" , "irrelevant" );
197
+ sink (replReceiver );
198
+
199
+ String replChar = "a" .replace ('a' , s .charAt (0 ));
200
+ sink (replChar );
201
+
202
+ String replCharReceiver = s .replace ('a' , 'b' );
203
+ sink (replCharReceiver );
204
+
205
+ String charAt = "" ;
206
+ for (int i = 0 ; i < 10 ; i ++)
207
+ charAt = charAt + s .charAt (i );
208
+ sink (charAt );
209
+
210
+ byte [] bytes = new byte [10 ];
211
+ s .getBytes (0 , 1 , bytes , 0 );
212
+ sink (bytes );
213
+
214
+ String replAll = s .replaceAll ("irrelevant" , "irrelevant" );
215
+ sink (replAll );
216
+
217
+ String replFirst = s .replaceFirst ("irrelevant" , "irrelevant" );
218
+ sink (replFirst );
219
+ }
192
220
}
You can’t perform that action at this time.
0 commit comments