mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Add models for commons lang/text's Str[ing]Lookup class
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import org.apache.commons.lang3.text.StrLookup;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
class StrLookupTest {
|
||||
String taint() { return "tainted"; }
|
||||
|
||||
void sink(Object o) {}
|
||||
|
||||
void test() throws Exception {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
map.put("key", taint());
|
||||
StrLookup<String> lookup = StrLookup.mapLookup(map);
|
||||
sink(lookup.lookup("key")); // $hasTaintFlow=y
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user